anonymous
  • anonymous
PS1: How'd I do? Here's my code, what do you guys think? x = 3 z = 3 w = 999 while w > 0: if x%z != 0: z = z + 2 else: if x == z: w = w - 1 # print x x = x + 2 z = 3 else: x = x + 2 z = 3 else: x = x - 2 print x # print 'edn'
MIT 6.00 Intro Computer Science (OCW)
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
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.
katieb
  • katieb
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
its alright
anonymous
  • anonymous
it works for problem #1, but where the second part? heres how i solved PS 1: from math import * #problem 1 primes = () for n in range(2, 7920): for i in range(2, n): if n % i == 0: break else: primes = primes + (n, ) #Problem 2 add = 0 l = 0 for x in range(0,1000): z = primes [x] ## print z add += log(z) print add / primes [x] ## print add, primes [x], add/ primes [x] what do you think?
anonymous
  • anonymous
See, I thought they wanted us to do a looping program. They asked us to generate possible solutions, test them, and use some end test which will stop the loop. Yours is great though. It looks a whole lot cleaner than mine. It appears that you have watched a few more video lectures than me. haha

Looking for something else?

Not the answer you are looking for? Search for more explanations.