python reference variable code example
Example 1: declaring variables in python
my_name = "your name here "
print(my_name)
Example 2: python send object reference to another function and edit property
class Test:
a = 1
def f(obj):
obj.a = 10
t = Test()
f(t)
Example 3: python variable
Python variable
Example 4: how to create a variable in python
variable1 = "value"
variable2 = 1000000
variable3 = 10000.0
variable4 = True
Example 5: how to define variable in python
saving = 100
print (saving)
Example 6: python pass by reference
myList = ['foo', 'bar']
def modifyList(l):
l.append('qux')
l = ['spam', 'eggs']
l.append('lol')
modifiyList(myList)
print(myList)