print first word of a string python and return it

def print_first_word():
    words = "All good things come to those who wait"
    print(words.split().pop(0))
    #to print the last word use pop(-1)
print_first_word()

Here is what the above code is Doing:
1. It defines a function called print_first_word.
2. It defines a variable called words and assigns it the string “All good things come to those who wait”.
3. It calls the split method on the words variable and assigns the result to the words variable.
4. It calls the pop method on the words variable and passes it the number 0.
5. It calls the print function and passes it the result of the pop method.