Write a program that takes a character as input (a string of length 1), which you should assume is an upper-case character; the output should be the next character in the alphabet.
If the input is 'Z'
, your output should be 'A'
.
Here's what i've done so far but I’m not getting A
when I input Z
. I’m getting [
.
Please help, what am I doing wrong?
input = (input()).upper()
for character in input:
number = ord(character) + 1
number1 = chr(number)
if ord('z'):
new_number = ord(character) - 25
number2 = chr(new_number)
print(number1)