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

hello guys, my IDLE shows a syntax error when I press the enter key after typing the 'else:' conditional statement. Please kindly assist me on this.

OpenStudy (turingtest):

could you post your code with a screenshot or something?

OpenStudy (anonymous):

Thanks buddy, have found a way around it. It had to do with indentation. However,kindly assist with this question: Write a program that examines three variables-x,y, and z- and prints the largest odd number among them. If none of them are odd, it should print a message to that effect.

OpenStudy (turingtest):

you can use the modulo operator % to test for even/odd. You can then use a combination of conditional statements that resemble the following pseudocode //initiate variable for largest even number so far (I'll call it "big") to None //if x is even, store its value in big //else if y is even and greater than big //update big to store y //else if z is even and greater than big //update big to store z //return big

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!