Focus mode

Python Temel

Update Input

Argümanların Değerlerinin Güncellenip Güncellenmediği Durumlar


Integer ve Floatların Değerlerin Değişmez


a = 2



def f(x):
    x = 4
    return x



f(a)



4



a


2



b = 3.4



f(b)



4



b



3.4


listler


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


left-disk

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!

right-cube

Test

Comments

You need to enroll in the course to be able to comment!