PR3_Studienleistung_1_Prof_.../s1_a61_2.py

19 lines
376 B
Python
Raw Normal View History

2022-11-09 12:30:01 +01:00
def space_to_minus(text):
split_text = text.split(" ")
return "-".join(split_text)
def reverse_text_till_komma(text):
text_list = text.split(",")
text_list[0] = text_list[0][::-1]
return ",".join(text_list)
def main():
print(space_to_minus("This is a test"))
print(reverse_text_till_komma("Hallo,Welt"))
if __name__ == "__main__":
main()