Python Forum
Potential confusion combining != with or
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Potential confusion combining != with or
#3
(Oct-29-2019, 08:18 PM)Aurthor_King_of_the_Brittons Wrote: I would try to split it into two statements/evaluations (one on each side of "or"). I don't have Python open as I'm at work, so my syntax may be off.

 while answer.lower() != "y" or answer.lower() != "n":

That doesn't work: both "y" and "n" result in the program staying in the while loop.
Reply


Messages In This Thread
RE: Potential confusion combining != with or - by Mark17 - Oct-29-2019, 08:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Potential Permission error on Mac OSX Catalina OWOLLC 2 2,116 Apr-24-2025, 04:45 AM
Last Post: TomBrooks
  Is it possible to use the full potential of scalene in Pycharm? arnoldpredator 4 2,254 Nov-18-2023, 01:46 PM
Last Post: arnoldpredator
  Potentiostat/Galvanostat potential issue pepe523869 10 4,987 Nov-05-2022, 07:08 PM
Last Post: pepe523869

Forum Jump:

User Panel Messages

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