Hello, I am having difficulty editing my solution for ps1a into a solution for ps1b. I had no problem with the ps1a, but this second part has left me completely clueless.. Any help will be appreciated, thanks.

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.

Hello, I am having difficulty editing my solution for ps1a into a solution for ps1b. I had no problem with the ps1a, but this second part has left me completely clueless.. Any help will be appreciated, thanks.

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

Here's my code for ps1a:
1 Attachment
First what you need to do is add the the command import math to the top of your code then add an assignment named sumOfPrimes=0. Under your if true statement add the command sumOfPrimes=sumOfPrimes+math.log(testInteger). Now depending on through what number of primes you want to add you need to change your number in the while loop.
I believe this is how you do it but I did it wrong the first time I did it because I misread the directions and I didn't want to redo it. So if anyone else has any suggestions please answer back.

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

I added some lines into your script. It should work. If any questions, feel free to ask me. ## Start from here from math import* testInteger = 1 #Number to be tested if prime numberOfPrime = 1 #Number of prime (changes if prime # found) lnproduct=log(2) n=300 while(numberOfPrime
Thanks, I ran that code and it seemed to work great, plus I understand the logic behind each addition. I appreciate the help!

Not the answer you are looking for?

Search for more explanations.

Ask your own question