s = "oh my god, I might fail this course" list_of_words = s.split() print(' '.join(list_of_words[::-1]))