Ask
your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW)
18 Online
I'm doing the intro to programming/python, if anyone else is running through it and would like to share some code/examples/problem, my email is snibor.ds@gmail.com Thanks
Still Need Help?
Join the QuestionCove community and study together with friends!
I think this works: ps1.py def isPrime(n): # this is a function created by me ri = 2 rf = n / 2 isPrim = 1 # yes for b in range(ri, rf+1): mod = n % b if mod == 0: isPrim = 0 # no return isPrim x = 2 lastPrime = 0 numbPrime = 1000 while lastPrime < numbPrime: # range from 0 to 999, i.e. 1000 if isPrime(x): # call function isPrime() print x lastPrime = lastPrime + 1 x = x + 1 Try: c:\Python27\ps1.py > ps1.txt to see the results in a .txt file.
Can't find your answer?
Make a FREE account and ask your own questions, OR help others and earn volunteer hours!
Join our real-time social learning platform and learn together with your friends!
Join our real-time social learning platform and learn together with your friends!
Latest Questions
SnowyBreaks:
You ever get the types of dreams where it feels as if you aren't breathing? And w
laylasnii13:
Poem/diary i wrote I Want Out Iu2019m so tired of screaming into walls. Every fight with my mom leaves something broken and itu2019s not just plates or slam
Countless7Echos:
Aye.. I need actually some help on the shading here.. if the light is from above too I just feel something is off.
Countless7Echos:
I don't know just no sketch doodle day :p finished a video already so I'm pretty
7 hours ago
6 Replies
0 Medals
1 day ago
13 Replies
3 Medals
2 days ago
19 Replies
3 Medals
5 days ago
9 Replies
2 Medals