Ask your own question, for FREE!
Computer Science 10 Online
OpenStudy (jadzia):

Python Exercise Question: http://snag.gy/xi2vC.jpg Input: 4, 5, bad data, 7, done Desired Output should be: `Invalid input` `Maximum is 7` `Minimum is 4` What I did so far:http://snag.gy/D3aZ3.jpg I keep getting the output wrong. I also tried using max() and min() function but it doesn't work either. Please someone kindly help me. I've been doing this problem since yesterday.

OpenStudy (rsmith6559):

Your program is dealing mostly with numbers, so initializing your variable to None isn't useful. If they were initted to 0, they'd be usable immediately. Your else statement should be executed before the elif statements. Stop and think about the correct inputs that you want. Remember that raw_input() returns string data. Check your input BEFORE you try to do any work with it.

OpenStudy (jadzia):

Oh I got it! Thank you so much :)

OpenStudy (rsmith6559):

You're welcome.

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!