Create 4 - Next Letter.py

This commit is contained in:
Lukas Baumann 2021-02-18 18:29:38 +01:00 committed by GitHub
parent 24ac7d28ab
commit 9ce9ac3e31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

7
07/a/4 - Next Letter.py Normal file
View File

@ -0,0 +1,7 @@
char = input()
if ord(char) == ord("Z"):
print("A")
else:
print(chr(ord(char) + 1))
# without if:
# print(chr((ord(input()) - ord("A") + 1) % 26 + ord("A")))