cos i tried testing 21 and 49, and they were tested as prime.
thanks!
What does this mean as "It is" or "It is not a prime number" will print y-1 times for each number tested, or until "not prime" is found. Add a print statement under the for() loop to print "i" and test with an odd number like 25, so prime is not found until 5 is tested. You only have to test for "can be divided by 2" once, and then use the step parameter of the for() to increment from 3, step 2=every other number so you don't waste time dividing by even numbers since you have already checked if it is divisible by 2. Also, the general assumption is that if you are too lazy to key in actual words instead of teeny-bopper slang, you are just lazy and looking for someone to do it for you, so there are very few responses.
woooee
Posting Maven
2,715 posts since Dec 2006
Reputation Points: 827
Solved Threads: 780
Skill Endorsements: 9
Yes, as 21=3*7, we can say for sure that your program has problem QED.
pyTony
pyMod
6,330 posts since Apr 2010
Reputation Points: 879
Solved Threads: 989
Skill Endorsements: 27