I’m trying to use the new match statementbut am running into some problems the following code doesn’t work as expected, as usual i’m certain i’m doing somthing stupid can anyone point out what it is?
inputstring = ""
while (inputstring.upper != "Q"):
inputstring = input("Enter selection without the full stop:")
match inputstring.upper:
case "H":
printtoolsmenu()
case "1":
pass
Enter selection without the full stop:H
Enter selection without the full stop:h
Enter selection without the full stop:h
Enter selection without the full stop:H
Enter selection without the full stop:"H"
Enter selection without the full stop:
>Solution :
As the comment pointed out you need to add parenthesis to actually call upper:
match inputstring.upper():