A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

Jadzia

  • one year ago

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.

  • This Question is Closed
  1. rsmith6559
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    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.

  2. Jadzia
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Oh I got it! Thank you so much :)

  3. rsmith6559
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    You're welcome.

  4. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.