Comment on The whole "toilet seat up, toilet seat down" gender debate could be solved by everybody putting the seat and lid down.
For me the algorithm is “if(wearing_glasses == True and is_brightly_lit == True): stand; else: sit”.
Your variables are already booleans, so you can just write:
if (wearing_glasses and is_brightly_lit)
Are they though? Maybe they are inputs that haven’t been sanitised but the language has two kinds of equals and is you use the double equals then it tries to coerce it for you. Lol that with would be silly!
yes but it makes it clearer to do isWearingGlasses == true
isWearingGlasses == true
AnAverageSnoot@lemmy.ca 8 hours ago
Your variables are already booleans, so you can just write:
if (wearing_glasses and is_brightly_lit)pretzelz@lemmy.world 6 hours ago
Are they though? Maybe they are inputs that haven’t been sanitised but the language has two kinds of equals and is you use the double equals then it tries to coerce it for you. Lol that with would be silly!
gandalf_der_12te@discuss.tchncs.de 5 hours ago
yes but it makes it clearer to do
isWearingGlasses == true