Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 23 Online
OpenStudy (anonymous):

Having trouble with Problem Set 1, Problem 1. Am I on the right track? I am trying to solve it without using functions since they have not yet been discussed in class. numPrimes = 1 num = 3 while numPrimes < 1000: for i in range(3, num/2, 2): if num % i == 0: break numPrimes += 1 num += 2 print(num) So I'm trying to combine the loop and conditional into one program. I feel like my thinking is correct, but I just can't put it out to code.

OpenStudy (rsmith6559):

Your code looks like it will work. Have lists been covered yet?

OpenStudy (anonymous):

They covered tuples, but since tuples are immutable I can't append to them

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!
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!