+ 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)
2 Respuestas
0
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 thnx
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)