Python Forum
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
cannot figure out
#2
I can't reproduce the issue, so please show us the output you're getting (your code looks fine to me, though I'd suggest using .lower() instead of handling both upper and lower case characters... or using "in" like if ti in "tTiI", or both: if ti.lower() in "it"):

>>> ti = input("? ")
? spam
>>> if ti=='t' or ti=='T' or ti=='i' or ti=='I':
...  print("Yep")
... else:
...  print("Nope")
...
Nope
Reply


Messages In This Thread
cannot figure out - by rturus - Mar-23-2017, 04:49 PM
RE: cannot figure out - by nilamo - Mar-23-2017, 06:33 PM

Forum Jump:

User Panel Messages

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