TrapdoorSmoke TrapdoorSmoke - 5 months ago 18
Python Question

Python if statement no cap check

I have a input that the user types in something
Example

Test = input( 'Type in something' )
if Test == 'SOMETHING' :
print( 'You idiot!' )


How do I ignore the if the word something is in all caps or non caps example:
Something
SOMETHING
SoMeThinG

Sorry My Grammar is so bad It's hard to word these things

Answer
if Test.upper() == "something".upper(): print("You idiot")

What about making the two parts of the equatation upper/lower?

Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> Test = input("type in something ")
type in something SomeTHING
>>> Test.upper() == "something".upper()
True
>>>