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

Doing the nugget question right now ..the one which asks for solution of Diophantine equation..i think i am getting caught with a infinite loop some where....the idle window just freezes when i run the code...working for a solution though..

OpenStudy (anonymous):

i know it's not a question...just to keep the group active :P

OpenStudy (anonymous):

ok here is my solution anyone up for comparison... its returning 43 as the answer..is it correct? http://dpaste.com/hold/563848/

OpenStudy (anonymous):

Here's my solution for part 1 of the nugget problem. http://dpaste.com/hold/563929/

OpenStudy (anonymous):

Here's my solution.. I've tried to make a program that solves the four problems, if you don't understand something, feel free to ask =) http://dpaste.com/hold/564040/

OpenStudy (anonymous):

sunu0000, your program is failing at the while loop condition, it says "while n:" and that will always be True (cause every number other than zero is considered as True for a boolean expression), think about a good condition to control the loop. P.S: I don't speak english, sorry if there's something wrong.

OpenStudy (anonymous):

Well the while is there just for the sake of it..I don't want it to interfere with the breaking mechanism...So I have put the condition to While n...The loop's control is actually controlled by the boolean order and the break statements and yes ..i like the method you use for the input.. And for the English speaking thing..I am no English..and u speak english just fine

OpenStudy (anonymous):

You're right sunu0000, it was my fault, I didn't see that part of your code. I hope my code helps you, and if you have some questions, don't hesitate to ask for help, I think that's why we all are in this study group anyway. It's great to know we all are from different parts of the world =)

OpenStudy (anonymous):

hey sunu0000 , i'm not able to understand the 34th line of your code, can you explain it?

OpenStudy (anonymous):

It just checks that the last 6 members of the tuple N are consecutive integers or not..

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!