From 8133caa0b02d05f1a04b56e810b9661fa28770e4 Mon Sep 17 00:00:00 2001 From: Thore <2120752@stud.hs-mannheim.de> Date: Fri, 11 Nov 2022 21:02:55 +0100 Subject: [PATCH] Aufgabe 6.2 vereinfacht --- s1_a61_2.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/s1_a61_2.py b/s1_a61_2.py index c5c9f95..27112f9 100644 --- a/s1_a61_2.py +++ b/s1_a61_2.py @@ -6,8 +6,5 @@ if __name__ == "__main__": # Aufgabe 6.2 s1 = "Hello, World" - tmp = "" - for current_char in range(s1.find(","), -1, -1): - tmp += s1[current_char] - s1 = tmp - print(s1) + s2 = s1[s1.find(","):0:-1] + print(s2)