From a7146cf23443e6ed80a89f51d01e2be1ca8f0222 Mon Sep 17 00:00:00 2001 From: Yakshith Rai M <106961136+Yakshithrai@users.noreply.github.com> Date: Sun, 27 Oct 2024 15:14:06 +0530 Subject: [PATCH] Create togglechar.py Python program to toggle each character in a string --- .../Python_Programs/togglechar.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Program's_Contributed_By_Contributors/Python_Programs/togglechar.py diff --git a/Program's_Contributed_By_Contributors/Python_Programs/togglechar.py b/Program's_Contributed_By_Contributors/Python_Programs/togglechar.py new file mode 100644 index 0000000000..550b3cecd5 --- /dev/null +++ b/Program's_Contributed_By_Contributors/Python_Programs/togglechar.py @@ -0,0 +1,11 @@ +String = 'GuDDuBHaiyA' +String1 = str() +for i in String: + if i.isupper(): + i = i.lower() + String1 = String1 + i + else: + i = i.upper() + String1 = String1 + i + +print(String + ' after changing ' + String1)