A community for students.
Here's the question you clicked on:
 0 viewing
anonymous
 6 years ago
i need help with problem set 1 b!!! anyone??? :) tx
anonymous
 6 years ago
i need help with problem set 1 b!!! anyone??? :) tx

This Question is Closed

anonymous
 6 years ago
Best ResponseYou've already chosen the best response.0This is what i got. Any comments? from math import * prime_candidate = 3 divisor = 2 prime_number = 2 given_number = 10000 partial_sum = log(2) print "2 is prime number 1" while prime_candidate <= given_number: while prime_candidate%divisor != 0: divisor=divisor+1 if divisor == prime_candidate: print prime_candidate, 'is prime' partial_sum = partial_sum + log(prime_candidate) prime_candidate = prime_candidate+2 divisor=2 else: prime_candidate = prime_candidate+2 divisor=2 else: print partial_sum, 'is the sum of all the logarithms of the' 'prime numbers between 2 and', given_number, print 'the previous sum.' print 'divided by', given_number ,'equals', partial_sum/given_number
Ask your own question
Sign UpFind more explanations on OpenStudy
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.