Python Forum
If statements won't work!!!! Plz help me. Thx
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If statements won't work!!!! Plz help me. Thx
#2
i am assuming you are not typing in yes or no? There is no condition for anything else. the second if should also be an elif. Finally You need an else clause for when the input is neither.

tuna = input("is tuna a fish")
if tuna == "yes":
    print("I know, course tuna is a fish")
elif tuna == "no":
    print("What are you talking about, of course tuna is a fish")
else:
    print('please enter yes or no')
Recommended Tutorials:
Reply


Messages In This Thread
RE: If statements won't work!!!! Plz help me. Thx - by metulburr - Oct-20-2018, 10:42 PM

Forum Jump:

User Panel Messages

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