+ 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 ответов
+ 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 :)