PR3_Skriptsprachen_GruppeD_SL1/s1_a61_2.py

14 lines
347 B
Python
Raw Normal View History

2022-11-05 15:33:32 +01:00
if __name__ == "__main__":
# Aufgabe 6.1
string_with_spaces = "This is a test"
string_with_dashes = string_with_spaces.replace(" ", "-")
print(string_with_dashes)
# Aufgabe 6.2
s1 = "Hello, World"
tmp = ""
for current_char in range(s1.find(","), -1, -1):
tmp += s1[current_char]
s1 = tmp
print(s1)