I am the new to Python. Here is a problem that I have encountered.
Assume that there is a function called set1(x)
.
Here is the code:
def set1(x):
x = 1;
When I run this,
m = 5
set1(m)
m
the value of m
is still 5.
So how should I code the function if I want the parameter to become 1 whenever I call the set1()
function?