I have problem in this code;
\'return\' outside function (, line 4) 4
This code from book called Lea
in this function the return
is not properly indented.
def break_words(stuff):
"""This function will break up words for us."""
words = stuff.split(' ')
return words
Your indentation is off, try this:
def break_words(stuff):
"""This function will break up words for us."""
words = stuff.split(' ')
return words
Indentation is a key component of Python, unlike some other languages - so it is important to ensure that your code is properly formatted.
Indentation matters in python. From what you've pasted the last two lines here are NOT int the scope of break_words.
def break_words(stuff):
"""This function will break up words for us."""
words = stuff.split(' ')
return words