例子中引用循环变量返回值为函数,所以会受到循环变量变化影响,任务中将返回值进行实际赋值,后续变量产生变化不对已赋值变量产生影响,不知道这么理解对不对
2020-09-24
#set方法作用,i guess
Animal('1', 1, '1')
print(dog.get_info())
dog.set_info('2',2,'2')
print(dog.get_info())
Animal('1', 1, '1')
print(dog.get_info())
dog.set_info('2',2,'2')
print(dog.get_info())
2020-09-23
L1 = ['bob', 'about', 'Zoo', 'Credit']
L2 = sorted(L1,key=str.lower)
print(L2)
L2 = sorted(L1,key=str.lower)
print(L2)
2020-09-18
File "index.py", line 8
SyntaxError: Non-ASCII character '\xe5' in file index.py on line 8, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
SyntaxError: Non-ASCII character '\xe5' in file index.py on line 8, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
2020-09-05