#问题 已知x=[3,2,4,1],执行语句x=x.sort()之后,x的值为()。#答案 None我知道x.sort()之后x变成[1,2,3,4]为什么答案是None呀
因为x.sort() 没有返回值哦
正确的写法是:
x=[3,2,4,1] x.sort() print(x)