Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
elif and if
#5
You are doing string comparisons and you need to do numeric comparisons.

Try something like:
age = int(input('age please'))
then remove the quotes from around your number comparison values.

Lewis
To paraphrase: 'Throw out your dead' code. https://www.youtube.com/watch?v=grbSQ6O6kbs Forward to 1:00
Reply


Messages In This Thread
elif and if - by jlgeter2002 - Mar-25-2018, 12:20 PM
RE: elif and if - by j.crater - Mar-25-2018, 12:28 PM
RE: elif and if - by jlgeter2002 - Mar-25-2018, 01:30 PM
RE: elif and if - by wavic - Mar-25-2018, 01:52 PM
RE: elif and if - by ljmetzger - Mar-25-2018, 02:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Whats the right way to refactor this Big if/elif/elif ? pitosalas 1 2,266 Jul-28-2019, 05:52 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020