0

Iam trying to perform pass by reference in python but it is not working

def fun(x,y,z):
    x=5
    y=5
    z=6
x=1
y=2
z=3

fun(x,y,z)
print(x,y,z)

The output that I get is

(1, 2, 3)

The output that I expected was

(5, 5, 6)
Anoop saju
  • 480
  • 3
  • 17

0 Answers0