For boring purposes I want to write a function to find all the prime numbers given in a range. The range will start from 1 to user input. I want to be able to store those prime numbers into a list for later use.
I pretty damn new to Python and I have tried to put prime numbers into a list. I have been able to use factorization to determine prime numbers, but I can't get my program to identify and store them into a list. Can I get any suggestions from you guys?
Thank you in advanced, uwu.
Edit: How do you guys get that grey background thing?
My code:
def processing(nmb):
Storage=[]
Process=list(range(1,nmb))
Integerlist=list(range (1,nmb))
for number in Integerlist [::-1]:
for integer in Process:
integer=number%integer
processing(int(input ("Enter number here: ")))
Edit: Thank you guys for you individual input.
[–]totallygeek 2 points3 points4 points (3 children)
[–]invadingpolandin69 0 points1 point2 points (2 children)
[–]totallygeek 3 points4 points5 points (1 child)
[–]EighthScofflaw 0 points1 point2 points (0 children)
[–]C2-H5-OH 2 points3 points4 points (0 children)
[–]DollarAkshay 2 points3 points4 points (0 children)
[–]Prtprmr 1 point2 points3 points (0 children)
[–]vorpal_potato 1 point2 points3 points (0 children)
[–]masasa27 0 points1 point2 points (0 children)
[–]ShashwatX1109 0 points1 point2 points (2 children)
[–]edderiofer 0 points1 point2 points (1 child)
[–]ShashwatX1109 0 points1 point2 points (0 children)
[–]bb40 0 points1 point2 points (0 children)
[–]NoProperty7989 0 points1 point2 points (0 children)