Python sort后赋值 操作陷阱时间:2022-12-24 23:09:32 x=[1,4,2,0] # 错误的方式,因为sort没有返回值 y=x.sort() type (y) #NoneType #正确的方式 x.sort() y=x[:]