So i tried to shift a single letter down the index scale such as 'a' becoming 'd' when you shift it '3', but now i want to do a whole word so every letter get shifted down at the same time, here is what i have so far:
Alphabet=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
W=input("Enter Word: ")
S=int(input("Please choose a number between -51 and 51: "))
I=(Alphabet.index(W))
J=I+S
if J>25:
print("Please choose a number that is between -51 and 51")
else:
print("Your code word is: ",Alphabet[J])
The output was:
Enter Word: today
Please choose a number between -51 and 51: 3
Traceback (most recent call last):
File"C:/Users/Owner/OneDrive/Documents/Python/Word Shift.py", line 4, in <module>
I=(Alphabet.index(W))
ValueError: 'today; is not in list
FYI, I am literally a beginner in python so i don't know a lot of "Stuff", If it isn't too much trouble can you please tell me where i went wrong and what each part of your coded solution does?