Guest User

Untitled

a guest
Mar 1st, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. cand=2
  2. test=range(2,cand+1)
  3. count=1
  4. while(count<100):
  5. #if cand%test==0: ##This was your first problem. Test is a list, not a number.
  6. for n in test: ##Try this 'for' loop instead.
  7. if cand%n==0:
  8. cand=cand+1
  9. else:count=count+1
  10. #if count==1000: ##You had another problem here. Your count values don't match.
  11. if count == 100:
  12. print cand
Advertisement
Add Comment
Please, Sign In to add comment