You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
303 B
Python
11 lines
303 B
Python
5 years ago
|
# Sire Kubisi, tady jsem vas dobehl
|
||
5 years ago
|
# Tohle single line sito je lepsi, kratsi a rychlejsi
|
||
5 years ago
|
# (Meril jsem to pomoci timeit)
|
||
|
|
||
|
from functools import reduce
|
||
|
|
||
|
def primes(n):
|
||
|
return reduce(lambda l, x: [y for y in l if y==x or y%x!=0], range(2, n), range(2, n))
|
||
5 years ago
|
|
||
|
print(primes(int(input("Zadej cislo: "))))
|