I'm trying to understand how functions work, referencing the example below. I understand that (stuff) is an argument passed into the function when called.
My question is about (' ') on line 4. It's formatted like an argument, and when I run the function these single quotes encapsulate each word. This has me befuddled, is it an argument? How does Python know to put each word inside these single quotes?
def break_words(stuff):
"""This function will break up words for us."""
words = stuff.split(' ')
return words
split(' ')is running thesplitfunction with the argument' 'which is a string, containing a single space. The return value ofbreak_workswill be something like['word', 'word2', 'word3']where each of the words is a string, by itself.