Focus mode
a = 2
def f(x):
x = 4
return x
f(a)
4
a
2
b = 3.4
f(b)
4
b
3.4
l = [1,2,3]
l2 = l.copy()
l2
[1, 2, 3]
l
[1, 2, 3]
l2[0] = 10
l2
[10, 2, 3]
l
[1, 2, 3]
def f(l):
l[0] = "a"
return l
f(l)
['a', 2, 3]
l
['a', 2, 3]
def f(l): l = ["a", "b", "c"] #l[0] = ["a", "b", "c"] return l
l = [1,2,3]
def f(x):
x[0] = 2
return x
def f(penguin):
penguin[0] = 2
return penguin
f(l)
[2, 2, 3]
l
[2, 2, 3]
l = [1,2,3]
def f(x):
l2= x.copy()
l2[0] = 2
return l2
f(l)
l
Programs to Accelerate Your Progress in a Software Career
Join our 4-8 month intensive Patika+ bootcamps, start with the fundamentals and gain comprehensive knowledge to kickstart your software career!
You need to enroll in the course to be able to comment!