Help with Scope on Computer Science course

https://www.codecademy.com/paths/computer-science/tracks/cspath-intro/modules/cspath-python-functions/lessons/intro-to-functions/exercises/scope

I had a question about this script:

def create_special_string(special_item):
   return "Our special is " + special_item + “.”

print(special_item)

The lesson states that special_item is not defined, but only defined in the function of create_special_string, so my question is what is the defined part of special_item within the create_special_string function? Does it equal 0 or nothing? The lesson did not state what it was, so I wonder what the computer thinks it is if we were to indent the print(special_item) to put it within the same scope. Would the parameter print out the same way since there is no argument specified?

Thanks,
MP

Given the function won’t execute until you call the function, nothing will be printed

when you call the function, the parameter will get a value from the argument, so whatever you pass as argument is printed

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.