I am a newbie to python so just a simple question about how python functions work since I am accustomed to C/C++ so here is my problem that I have a list:
a = ['0','1','2','3','4','5','6','7','8','9']
and I have a function which takes two elements of list and swap them:
def swap(d,e):
temp = e
e = d
d = temp
now when I pass it arguments like suppose
swap(a[0],a[5])
it doesn't do anything I mean list remains unaltered.Also I have defined my function at the very begining of the py file so also when I insert print temp like
def swap(d,e):
temp = e
print temp
e = d
d = temp
it gives me correct value say what a[5] is I mean if I have done anything like this in C