Understanding scope is important when working with functions. The value of x was defined to be 1 (below), so why do we get an error when we inquired about its value?
def add_one(number): x=1 number=number+x print(number) >>> add_one(5)6>>> xNameError: name 'x' not defined
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.