starting learning python and now encountered the prime number quiz. As I couldn't do it by my self, I looked up lots of answers and this was one of the easiest answers:
#Take the input from the user:
lower = int(input("Enter lower range: "))
upper = int(input("Enter upper range: "))
for num in range(lower,upper + 1):
if num > 1:
for i in range(2,num):
if (num % i) == 0:
break
else:
print(num)
Now my problem is I couldn't understand the statement of the second loop
for i in range(2,num):
I understand we need to do a second check for numbers that are not divided by 2 but are divided by 3,5,7 etc. (like 9, 15, etc.) But I cant seem to wrap my head around what that loop does. tried looking for more detailed explanation but it seemed my English isn't keeping up with the tutorials(my 3rd language)
So if anyone can take his/her time to explain to a low level English speaker as simply as possible ill be so grateful.