This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List of prime numbers from 1 to N in a line in Python | |
# Lista de números primos de 1 a N en una linea en Python | |
def prime_numbers(n): | |
return ([2] + [x for x in range(3, n+1, 2) if not [y for y in range(3, int(x**0.5)+1, 2) if (float(x) / y).is_integer()]]) if n >= 2 else [] | |
print(prime_numbers(100)) |