Python Forum
Unexpected output: if statement
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unexpected output: if statement
#2
if action == "Krypter" or "krypter":
this if condition is always True
what you want is
if action == "Krypter" or action == "krypter":
but there are alternatives
if action in ["Krypter", "krypter"]
or
if action.lower() == "krypter":
Reply


Messages In This Thread
Unexpected output: if statement - by CabbageMan - Sep-04-2019, 04:04 PM
RE: Unexpected output: if statement - by ThomasL - Sep-04-2019, 04:12 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Unexpected output when trying to attach files in a mail application PythonU2Novel 0 403 May-17-2024, 02:59 AM
Last Post: PythonU2Novel
  Unexpected output Starter 2 606 Nov-22-2023, 12:08 AM
Last Post: Starter
  Unexpected Output - Python Dataframes: Filtering based on Overlapping Dates Xensor 5 880 Nov-15-2023, 06:54 PM
Last Post: deanhystad
  Unexpected output while using random.randint with def terickson2367 1 615 Oct-24-2023, 05:56 AM
Last Post: buran
Question Common understanding of output processing with conditional statement neail 6 1,029 Sep-17-2023, 03:58 PM
Last Post: neail
  Unexpected output from df.loc when indexing by label idratherbecoding 6 1,358 Apr-19-2023, 12:11 AM
Last Post: deanhystad
  Help with output from if statement fgaascht 6 2,112 Jan-17-2022, 02:53 PM
Last Post: perfringo
  unexpected output asyrafcc99 0 1,551 Oct-24-2020, 02:40 PM
Last Post: asyrafcc99
  Unexpected output: symbols for derivative not being displayed saucerdesigner 0 2,133 Jun-22-2020, 10:06 PM
Last Post: saucerdesigner
  Calculation using output of if statement StephenBeckman 3 2,131 Feb-07-2020, 10:19 PM
Last Post: jefsummers

Forum Jump:

User Panel Messages

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