# Title: Reverse words in a string
# Heading: Python Program to Reverse Words in a String
# Level: beginner
# Tags: reverse words, split, join, string slicing
# About: Reverses the order of the words in a sentence, keeping each word spelt forwards, with split(), list slicing and join().

def reverse_words(sentence):
    """The sentence with its words in reverse order."""
    words = sentence.split()
    return " ".join(words[::-1])


sentence = "Python is fun to learn"
print("Original:", sentence)
print("Reversed:", reverse_words(sentence))
