Ask coding questions

← Back to all posts
It seems to get caught on the first date and dosen't update high
19pipejo (0)

Dose anyone know how to fix this?

InvisibleOne (2678)

I don't think that you you can check if a boolean is greater then another boolean, since they are True or false, you can only check if they are equal to, or equal to (if I'm wrong let me know)

LukeWright (114)

@InvisibleOne @19pipejo he could check the boolean's values and then assign them integers based on that with something like

class vars:
 var1 = True
 var2 = False
def assignvars():
 if vars.var1 == True:
  vars.var1 = 1
 elif vars.var1 == False:
  vars.var1 = 0
 if vars.var2 == True:
  vars.var2 = 1
 elif vars.var2 == False:
  vars.var2 = 0
if vars.var1 > vars.var2:
 print("var1 is greater than var2")
elif vars.var1 < vars.var2:
 print("vars2 is greater than var1")
elif vars.var1 == vars.var2:
 print("both variables have the same value")
InvisibleOne (2678)

Rather then do all that, since you know that True, is 1, and False is 0.

if var1 == True:
  # you know that var1 is greater then false since we know they aren't the same
elif var1 == False:
  # you know the var1 is not greater then var two. 


LukeWright (114)

Whatever condition you are setting it to, it is not returning as true:
If this helped, click the checkmark next to my comment!