:::python
def fun(arg=[]):
arg.append('A')
print(arg)
fun()
# ['A']
fun()
# ['A', 'A']
第二个
:::python
a = [1, 3, 4]
b = {"a": 7}
a += b
a
>>> [1, 3, 4, 'a']
:::python
def fun(arg=[]):
arg.append('A')
print(arg)
fun()
# ['A']
fun()
# ['A', 'A']
第二个
:::python
a = [1, 3, 4]
b = {"a": 7}
a += b
a
>>> [1, 3, 4, 'a']