I was to print the contents of a variable, despite the fact that the variable exists inside a def. This is what my code looks like:
def count_words():
var_one = "hello world"
print count_words.var_one
The above does not work. I get the following error:
AttributeError: 'function' object has no attribute 'hello'
How do I get around this?