June 2018
Beginner
508 pages
13h 8m
English
This is something that can be tricky to understand at first, so let's look at an example:
# key.points.assignment.pyx = 3def func(x): x = 7 # defining a local x, not changing the global onefunc(x)print(x) # prints: 3
In the preceding code, when the x = 7 line is executed, within the local scope of the func function, the name, x, is pointed to an integer with a value of 7, leaving the global x unaltered.
Read now
Unlock full access