From 9ce9ac3e3194236f6dd0594536a90201c44fdf99 Mon Sep 17 00:00:00 2001 From: Lukas Baumann Date: Thu, 18 Feb 2021 18:29:38 +0100 Subject: [PATCH] Create 4 - Next Letter.py --- 07/a/4 - Next Letter.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 07/a/4 - Next Letter.py diff --git a/07/a/4 - Next Letter.py b/07/a/4 - Next Letter.py new file mode 100644 index 0000000..54f02dc --- /dev/null +++ b/07/a/4 - Next Letter.py @@ -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")))