+ 1
Write a python program that prints prime number
code is required
7 Réponses
+ 9
for num in range(2,101):
if all(num%i!=0 for i in range(2,num)):
print (num)
worked well in my ubuntu terminal..!!
+ 8
n = int(input())
flag = 0
for i in range(2,n):
if(n%i==0):
flag = 1
if(flag):
print("Number is not prime")
else:
print("Number is prime")
+ 3
print([i for i in range(2,100) if not list(filter(lambda j:i%j==0, range(2,i)))])
replace 100 with the max number
+ 1
Ultra fast one liner - best for large Ns https://code.sololearn.com/cQq22e5PF7wY/?ref=app
+ 1
https://code.sololearn.com/crZkkz38H2Ts/?ref=app