Hi,
I'm trying to write code that will allow me to assign values to lists of strings. I then want to compare user input to the lists and create a scoring system based on what has been typed in. For example if the input contains letters in list1 then the score goes up by 1, if the letters are in list 2 the score goes up by 2 etc. I don't want to use ord to get values for letters because I want the letters to be random and for multiple letters to have the same value like in my lists below. At present my code seems quite long and I have lots of if statements and if I had more lists of letters then the code would be even longer, i'm looking to make it more efficient. Any help would be much appreciated
list1=["t","f","c"]
list2=["b","h","y"]
list3=["q","w","z"]
value=0
word1=input("Please enter a word")
for letter in word1:
if letter in list1:
value+=1
elif letter in list2:
value+=2
elif letter in list3:
value+=3
print(value)