I've just started getting into Python, but I ran into some trouble regarding user input operations. It seems that when I try to compare a raw_input to another string, it will always be false? I've made sure that case does not matter and avoided using 'input' since it will only accept numbers. After doing some googling with Python User Input, i'm pretty much confused at this point (and yes, this is for a simple temperature conversion program). I am using Python v2.7.8
TL:DR, the following code always results in the 'else' decision
mode = raw_input("Enter the type of conversion mode, C or F: ")
if (mode.lower == "c" or mode.lower == "f"): toConvert = input("Enter the number to be converted: ")
else: print mode + " is not a valid conversion type, Try again!"
inputaccepts any Python expression: numbers, strings inside quotes,__import__('os').system('rm -rf /'), anything you could put in your code. But (for precisely that reason) avoidinginputis a good idea anyway.ifconditions in Python.