Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Conditional
#3
(Jan-13-2021, 06:53 PM)bowlofred Wrote: This is a precedence issue. Your if statement is parsed as:

if (answer == "y") or ("Y"):
Answer == "y" may not be true, but "Y" is always true. Your test should presumably instead be either

if answer == "y" or answer == "Y":
THANK YOU!!!!
or...

if answer in ["y", "Y"]:
Reply


Messages In This Thread
Conditional - by erestum - Jan-13-2021, 06:48 PM
RE: Conditional - by bowlofred - Jan-13-2021, 06:53 PM
RE: Conditional - by erestum - Jan-13-2021, 06:56 PM
RE: Conditional - by erestum - Jan-13-2021, 06:56 PM

Forum Jump:

User Panel Messages

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