I'm trying to figure out how to pass these values by reference.
I would like to print the "aNumber" variable as having the value 100, but is in not being updated.
And I would like to print the "someList" list as having the value (100, 100), but it is not being updated.
Any idea why?
Thank you very much.
This is the program:
#################################
def makeIt100(aVariable):
aVariable = 100
aNumber = 7
print(aNumber)
makeIt100(aNumber)
print(aNumber)
##################################
def changeTheList(aList):
aList = (100, 100)
someList = (7, 7)
print(someList)
changeTheList(someList)
print(someList)
##################################
This is the result I get:
7
7
(7, 7)
(7, 7)