Oct-02-2017, 02:44 PM
The below has no synthetical or static semantic errors in it, but does not run as expected. Namely, I want my shell to print "string involved" if the type of varA or varB is string; instead it prints nothing. Could anyone help me understand what is wrong with my code and how to fix it?
varA = 1 varB = "A" if (type(varA) and type(varB)) is (int or float): if varA > varB: print("bigger") if varA == varB: print("equal") if varA < varB: print("smaller") elif (type(varA) or type(varB)) is str: print("string involved")