Share your repls and programming experiences

← Back to all posts
iq test and calculator
KovidhSingh (1)

this file contains a calculator and random number generator

Comments
hotnewtop
Spacecraft (152)

This doesn't work because of how you are using or in the IF statements:

if operation.lower() == ("addition" or "+" or " +"):

In order for this to work, the IF statements would need to be written like this:

if operation.lower() == "addition" or operation.lower() == "+" or operation.lower() == " +":

This is why the code always defaults to the else division option, because it can't find any other comparisons that match.

KovidhSingh (1)

@Spacecraft That makes sense, thank you! The written commands should work though.