+ 1

How can make my output into a list

def is_prime(num): return [i for i in range(2,num) if num % i ==0]==[] def get_prime(): num=2 while num < 10: if is_prime(num): yield num num+=1 for i in get_prime(): print(i)

13th Jun 2020, 5:58 AM
Tanjir Ahmed
Tanjir Ahmed - avatar
2 Respostas
13th Jun 2020, 6:07 AM
Tanjir Ahmed
Tanjir Ahmed - avatar