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

I am having problems with finger exercise 2.2.Can anyone please tell me where I went wrong? Thanks a Lot ##x = int(raw_input('Enter an Integer:')) ##y = int(raw_input('Enter an Integer:')) ##z = int(raw_input('Enter an Integer:')) ##if x > y and x > z: ## if x%3 == 0: ## print 'x is largest odd number' ##if y > z: ## if y%3 == 0: ## print 'y is largest odd number' ##if z%3 == 0: ## print 'z is largest odd number' ##else ## print 'there are no odd numbers'

OpenStudy (turingtest):

I don't know the specifications of this problem, but I don't understand why you check `z % 3 == 0` each time. Please explain the nature of the problem; I doubt anyone here knows the course well enough to have memorized each question.

OpenStudy (rsmith6559):

Odd/even checking is usually done with ( ( x % 2 ) == 0 ) . 3 doesn't make sense to me. Something like this, you may want to consider if elif else instead of many if statements. IMO, liberal use of parenthesis in comparisons make the logic much more apparent.

OpenStudy (bibby):

to specify further, there are two cases to hand when doing x mod 2 x mod 2 == 1 -> odd x mod 2 == 0 ->even

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!
Latest Questions
XShawtyX: Art, Short Writing Assignment: Imagining Landscapes
6 hours ago 2 Replies 0 Medals
XShawtyX: Chemistry, Help ud83dude4fud83cudffe
6 hours ago 13 Replies 1 Medal
kaelynw: tried a lil smt, the arm is off but i like the other stuff
17 hours ago 27 Replies 3 Medals
kaelynw: art igg
15 hours ago 14 Replies 2 Medals
XShawtyX: Art
3 days ago 6 Replies 0 Medals
Nina001: teach me how to draw or just tell me the basics
3 days ago 2 Replies 1 Medal
XShawtyX: We doing another drawing gimme ideas to add to this
3 days ago 9 Replies 1 Medal
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!