0

Can you write a code for me (using Python 3), please?

I wanna write a code that collect the prime numbers that are before the number which I(or the user of my program) input. For example : The input :11 The output :17(2+3+5+7) And so on... Can I do it with out a (for loop)?

21st Apr 2020, 12:10 AM
Jana
3 Respostas
0
A=int(input('enter number\n')) Print(A*A*A)
21st Apr 2020, 1:40 AM
anand Pandit
anand Pandit - avatar
0
After defining your is_prime() function, you can avoid for loops like so: sum(filter(is_prime, range(limit)))
23rd Apr 2020, 4:22 PM
Zuke
Zuke - avatar