================
>>> a={"s":1,"t":2}
>>> def k(a):
... print a
... a['u']=3
... print a
...
>>> a
{'s': 1, 't': 2}
>>>
>>>
>>> k(a)
{'s': 1, 't': 2}
{'s': 1, 'u': 3, 't': 2}
>>>
>>>
>>> a
{'s': 1, 'u': 3, 't': 2}
>>>
list
================
>>> a=[2,4]
>>>
>>>
>>> def k(a):
... print a
... a.append(6)
... print a
...
>>>
>>> a
[2, 4]
>>>
>>> k(a)
[2, 4]
[2, 4, 6]
>>>
>>> a
[2, 4, 6]
>>>
================
>>> a = ['2','4','6','8','10']
>>>
>>>
>>> "/".join(a)
'2/4/6/8/10'
>>>
================
More.....
No comments:
Post a Comment