Having trouble returning x
I wrote this code to take input, and then check each character of the string and add numers together dependant upon which letter it reads: W = input("Enter a Word: ") print (W) r = 0 for i in W: r += 1 print (r) This is how I take the word from the user and find the length of the word. This next bit of code is a little wet but its supposed to check each letter in the string, and depending on that letter; a number is added to x: w1 =[W] i = 0 x = 0 while i < r: if (w1 [0][i]) == 'A' or 'a' or 'J' or 'j' or 'S' or 's': i += 1 x += 1 elif (w1 [0][i]) == 'B' or 'b' or 'K' or 'k' or 'T' or 't': i += 1 x += 2 elif (w1 [0][i]) == 'C' or 'c' or 'L' or 'l' or 'U' or 'u': i += 1 x += 3 Print (x) Let's say "ABC" is input. It should add 1 to x for a, +2 for b and ×3 for c making x = 6. However when I try it, it will only give 3 or however many letters are in the input. Can anyone tell me why or how to adjust this so it gives me 6 as intended?