Discussion Forum Cs 1101 Unit 2
Discussion Forum Cs 1101 Unit 2
Example 2
def say_something(something: str): #something is the parameter
print("crazy", something)
Example 3
def say_something():
some = 50
print(some)
Example 4
def say_something(some):
some_inside = some
return some_inside
say_something(6)
print(some)
If we try and access the parameter from outside of the function, we will receive a name error is
not defined as the parameter is not defined outside of this function.
Example 5
some = 6
print(some)
def something():
some = 14
print(some)
something()