+ 7
How can u ensure the case of an input function doesn't affect the output?
choice = input () if choice = "A" and the user inputs a
8 Answers
+ 9
As Mind To Machine đ»đ said U can also use .lower() or .upper()
Lower() will make all the letters in lowercase and upper will make all the letters in upper case.
Choice=input().lower() # A >> a
if (Choice=='a'):
print("...")
Thanks
+ 9
Convert to case of your choice, you use the built-in functions as stated above. đđâ
+ 5
you can use upper() or lower() methods to convert string to one case before testing
+ 5
it worked. ..Thanks alot
+ 4
if choice == âAâ or âaâ:
+ 4
Thanks đ
+ 4
i will try that now
+ 1
welcome :)