Hi, I have been working on the 1st problem of ps. 1 can someone tell me what is wrong with my code, I can't get it to work. Thanks. y=7 prime=3 t=3 while prime<1000: if y%t==0: y=y+2 if y%t>0 and t<(1/2)*y: t=t+2 if y%t>0 and t==(1/2)*y: t=3 y=y+2 prime=prime+1

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get our expert's

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions.

A community for students.

Hi, I have been working on the 1st problem of ps. 1 can someone tell me what is wrong with my code, I can't get it to work. Thanks. y=7 prime=3 t=3 while prime<1000: if y%t==0: y=y+2 if y%t>0 and t<(1/2)*y: t=t+2 if y%t>0 and t==(1/2)*y: t=3 y=y+2 prime=prime+1

MIT 6.00 Intro Computer Science (OCW)
See more answers at brainly.com
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions

What is % do?
it gives you the remainder
Oh ok.

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

What happens if y = 53 and t = 27?
i changed that and now it gives me a number but it isn't prime and it is far from the 100th prime.
Getting it all in one while loop gets pretty complicated. If you can do it then great, but it wont look pretty. I looked it up online and I saw people split it up into a function and function or a function and while loop. For example- try splitting it up into - findPrime(number) function: code while count<1000 code Here is a website that really helped- http://pythonism.wordpress.com/2008/05/04/looking-at-prime-numbers-in-python/

Not the answer you are looking for?

Search for more explanations.

Ask your own question