01 / 06
Make it inside, call it outside
Make a variable inside a function, then try to show it outside the function. It looks as though it ought to work, and it does not.
Inside the function good morning came out fine. The moment we stepped outside, Python said it had never heard of the name.
def greet(): word = "good morning" print(word)greet()print(word)Result
good morning NameError: name 'word' is not defined