Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 14 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
AsianPanda08: What should i eat for dinner tonight? I can't choose
1 hour ago 51 Replies 2 Medals
Nina001: Trying 2 figure out what is the square root of 8746685
8 minutes ago 30 Replies 2 Medals
SnowyBreaks: Is it bad to lose 3.8 pounds in less than 2 days?
39 minutes ago 43 Replies 0 Medals
kaelynw: tried a lil smt, the arm is off but i like the other stuff
46 seconds ago 11 Replies 2 Medals
laylasnii13: Who wanna write or make a song with me???
5 hours ago 8 Replies 0 Medals
kaelynw: art igg
13 hours ago 13 Replies 2 Medals
XShawtyX: Art
1 day ago 6 Replies 0 Medals
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!