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

Has anyone completed the exercise on page 16 of the course textbook? My head hurts.

OpenStudy (anonymous):

the finger excercise??

OpenStudy (anonymous):

yes, the finger exercise. Been trying hard using mod == and != etc but no success

OpenStudy (anonymous):

windows, unix, mac?? idle, ipython?? the documentation should be on your computer - F1 while working in idle. The Python mod operator is %. spoiler: http://dpaste.com/810243/ online docs: http://docs.python.org/library/stdtypes.html#numeric-types-int-float-long-complex

OpenStudy (anonymous):

thanks, I understand the operators i think. Its actually getting the code (or maths) to solve this problem is what I am struggling with. In english (not code), how do I solve it?

OpenStudy (anonymous):

a number is odd if it cannot be evenly divided by 2 so if you divided an od number by two there is always a remainder or the mod operator returns the remainder of the division. so any oddNbr % 2 will produce an integer greaqter than zero. so you are given three numbers 1st you have to test if each us odd when you test a number if it is odd you have to somehow keep track of that when you are done testing for oddness if none of them were odd you print a statement to that effect if any of them are odd you have to figure out which one is the biggest/largest after you have figured out which one is largest, print it

OpenStudy (anonymous):

Thank you kindly. you have confirmed I was on the right track. My trouble is actually writing the code. This is something I need to practice. Thanks for the spoiler alert as I want to try this solo first.

OpenStudy (anonymous):

Cracked it. Thanks

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!