我的理解是 Python 字符串是不可变的。
我试了下面的代码:
a = "Dog"
b = "eats"
c = "treats"
print a, b, c
# Dog eats treats
print a + " " + b + " " + c
# Dog eats treats
print a
# Dog
a = a + " " + b + " " + c
print a
# Dog eats treats
# !!!
难道巨蟒不应该阻止这次任务吗? 我可能漏掉了什么。
知道吗?