I am trying to do some coursework but I have hit a wall. I am trying to write a function that takes a letter and a digit as the inputs, and returns the letter shifted key positions to the right in the alphabet. This is what I have so far:
def code_char(c,key):
letter=input("Enter letter to be moved")
shift=int(input("Enter degree of shift"))
letter=ord(letter)
if letter>=65 and letter <=90:
letter=letter+shift
while letter>90:
letter=letter-26
elif letter>=97 and letter <=122:
letter=letter+shift
while letter>122:
letter=letter-26
letter=chr(letter)
print(letter)
code_char("",0)
The problem is the letter=ord(letter) as I keep getting TypeError: ord() expected string of length 1, but list found. I have tried different variations. I need to convert the input 'letter' into ASCII.