The following piece of code is showing an error:
if ((type(varA) or type(varB) ) == type('t')):
print "string involved"
elif varA<varB:
print "RANDOM"
the error is for this case:
Test Values: varA = 0, varB = adios
output:
RANDOM
while this other piece of code
if ((type(varA) == type('t')) or (type(varB)== type('t'))):
print "string involved"
elif varA<varB:
print "RANDOM"`
For the following test values:
Test Values: varA = 6, varB = adios
ouput is as follows:
string involved
What is the difference between these two "if" conditions? I am finding them to be of the same logic!
(a || b) == something, when you mean(a == something) || (b == something).