Ask
your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW)
30 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
Ferrari:
Hi, this is something I wrote last year as a freshman. "My first regular-length song, by Rari.
curriful:
small doodles, tell me what you think and if theres anything i can do better.
Breathless:
Finally- I finished! this one is really going to be my favorite
gelphielvr:
(algebra 1) not looking for the answer. Does anyone know if this question is aski
Yosad930:
okay another random question that even google itself isnt helping me with: why cant i zoom in and out anymore with the touchpad? yk how when you pinch your
AddieroniAndCheese:
Tips for studying for an AP exam in like a week? I barely know anything about chem T-T.
thereneelg:
Ok so. I need help. So for one of my songs in choir, The Power of Love. We have to hold one of the "Love"s for a long time.
3 hours ago
7 Replies
2 Medals
2 hours ago
12 Replies
1 Medal
1 hour ago
12 Replies
0 Medals
1 day ago
7 Replies
1 Medal
1 day ago
10 Replies
1 Medal
1 day ago
5 Replies
1 Medal
6 hours ago
14 Replies
2 Medals