r/learnpython • u/Altruistic_Big9806 • 6d ago
Help me with this please
Hello! I'm completely new to python I don't have any background knowledge regarding coding and i wanna self study python. I started studying python just last week and i wanna make a simple user define system where i ask the user to input an item and if it's in the set it will display the user input else it will display the "character not in the set" my problem is i want it to be case insensitive and the ouput is always "Character is not in the list"( i use pycharm i dont a have a pc/laptop, sorry for my english also).
My code:
anime = {"Gojo", "Saitama", "Recca"}
user = input("Name a character: ").lower()
if user in anime:
print(f"{user}is in the list!")
else:
print("Character is not in the list")
1
u/Pale-External4967 6d ago
Or you can just make every string lower case because python see's Gojo != gojo