Python Forum
applying 2 conditions to a loop
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
applying 2 conditions to a loop
#2
Quote: SOLVED: I was trying
if maxScore == 'None':
continue

I needed to write

if str(maxScore) == 'None':
continue

Don't use str() like this, just refer to None itself, instead of a string which happens to contain "None".
>>> x = None
>>> x == "None"
False
>>> x is "None"
False
>>> x == None
True
>>> x is None
True
Reply


Messages In This Thread
applying 2 conditions to a loop - by Pedroski55 - Nov-07-2017, 04:38 AM
RE: applying 2 conditions to a loop - by nilamo - Nov-08-2017, 07:11 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  gspread - applying ValueRenderOption to a range of cells dwassner 0 2,405 Jan-12-2022, 03:05 PM
Last Post: dwassner
  Applying function mapypy 1 3,006 Mar-11-2021, 09:49 PM
Last Post: nilamo
  Applying Moving Averages formula to a number lynnette1983 1 2,623 Sep-29-2020, 10:21 AM
Last Post: scidam
  Hi, I need help with defining user's input and applying it to code. jlmorenoc 2 3,103 Jun-24-2020, 02:10 PM
Last Post: pyzyx3qwerty
  Help with applying this instrument monitoring code to multiple inputs. Kid_Meier 1 2,838 Mar-04-2020, 12:01 PM
Last Post: Kid_Meier
  How does while-If-elif-else-If loop conditions check run mrhopeedu 2 2,735 Oct-27-2019, 04:56 AM
Last Post: mrhopeedu
  Do break operators turn while loop conditions from True to False? Drone4four 5 4,440 Oct-24-2019, 07:11 PM
Last Post: newbieAuggie2019
  applying and(&) ,or(|) in conditions does not result output correctly as expected Smiling29 4 3,534 Oct-21-2019, 01:39 AM
Last Post: ichabod801
  Applying row height to all rows including and after row 7 curranjohn46 2 8,922 Oct-14-2019, 03:10 PM
Last Post: curranjohn46
  for loop with 2 conditions vaison 9 8,024 Apr-19-2018, 01:28 PM
Last Post: vaison

Forum Jump:

User Panel Messages

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