PR3_Skriptsprachen_GruppeD_SL1/s1_a61_2.py

11 lines
267 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"
2022-11-11 21:02:55 +01:00
s2 = s1[s1.find(","):0:-1]
print(s2)