From 7d43682bd633912da521fcdf022efb1594dd30c8 Mon Sep 17 00:00:00 2001 From: Lukas Baumann Date: Thu, 18 Feb 2021 09:21:27 +0100 Subject: [PATCH] Create 2 - Lower-case String.py --- 11/a/2 - Lower-case String.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 11/a/2 - Lower-case String.py diff --git a/11/a/2 - Lower-case String.py b/11/a/2 - Lower-case String.py new file mode 100644 index 0000000..8113d44 --- /dev/null +++ b/11/a/2 - Lower-case String.py @@ -0,0 +1,10 @@ +def lowerChar(char): + if 65 <= ord(char) <= 90: + return chr(ord(char)+32) + return char + +def lowerString(string): + out = "" + for i in range(len(string)): + out += lowerChar(string[i]) + return out