Currently, I am taking some computer science lessons online. I have been issued the task of writing a program that, upon a valid input, will print the next letter in the alphabet. Here is my code:
char = input()
ordchar = ord(char)
nextletter = ordchar + 1
nextletter = chr(nextletter)
if nextletter == ("["):
print("A")
if nextletter == ("{"):
print("a")
if nextletter!=("[","{"):
print(nextletter)
Now, I do see the problem with the code, though I don't know how to rectify it. Basically, on the second to last line of code, I want it to essentially say "if nextletter does not equal { or [ print nextletter".