Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple Or Statements
#2
would you please share relevant code as well as full traceback you get.
not to mention that your statement does not make sense - it will be always True
spam = ['foo', 'bar', 'woo']

for eggs in spam:
   if eggs != 'foo' or eggs != 'bar':
      print(eggs)
maybe you want and?
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
Multiple Or Statements - by JoeDainton123 - Sep-15-2020, 07:15 PM
RE: Multiple Or Statements - by buran - Sep-15-2020, 07:22 PM
RE: Multiple Or Statements - by JoeDainton123 - Sep-15-2020, 07:29 PM
RE: Multiple Or Statements - by buran - Sep-15-2020, 07:34 PM
RE: Multiple Or Statements - by bowlofred - Sep-15-2020, 07:38 PM
RE: Multiple Or Statements - by buran - Sep-15-2020, 07:45 PM
RE: Multiple Or Statements - by JoeDainton123 - Sep-15-2020, 07:53 PM
RE: Multiple Or Statements - by buran - Sep-15-2020, 07:56 PM
RE: Multiple Or Statements - by buran - Sep-15-2020, 08:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Multiple Loop Statements in a Variable Dexty 1 1,258 May-23-2022, 08:53 AM
Last Post: bowlofred
  SyntaxError: multiple statements found while compiling a single statement Kayode_Odeyinka 1 3,052 Mar-12-2020, 05:50 PM
Last Post: micseydel
  Multiple IF statements kamacaziYakuta 1 2,083 May-04-2019, 05:46 PM
Last Post: MvGulik
  optimize choices in multiple if ---: statements Pedroski55 2 2,952 Dec-25-2018, 05:06 AM
Last Post: Pedroski55
  SyntaxError: multiple statements found while compiling a single statement DragonG 1 5,532 Nov-26-2018, 05:33 AM
Last Post: Larz60+
  How to reliably split string containing multiple sqlite statements? shanepy 2 2,650 Nov-21-2018, 12:07 AM
Last Post: shanepy
  How to execute a string with multiple sqlite statements and print results? shanepy 0 2,301 Nov-20-2018, 10:19 PM
Last Post: shanepy
  Multiple "return" statements or "result" variable? WolfWayfarer 7 7,958 Jul-25-2018, 07:51 AM
Last Post: perfringo

Forum Jump:

User Panel Messages

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