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()