friends = ['a', 'b', 'c', 'd']for friend in friends: print(friend + ' i love you')friends[0] = 'e'print(friends)
以上程序没有错误。很明显,的你for写的有问题,元素名不能和列表同名。