14 lines
347 B
Python
14 lines
347 B
Python
|
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)
|