my_frind = ['曹大鹏','王姐','李妍']
a = ['ab','fg','cg']
b = a.sorted()
print(b)
AttributeError: 'list' object has no attribute 'sorted'
sort()是方法,sorted()是函数,方法是调用,函数进行数据传递
a = ['ab','fg','cg']
print(sorted(a))
my_frind = ['曹大鹏','王姐','李妍']
a = ['ab','fg','cg']
b = a.sorted()
print(b)
AttributeError: 'list' object has no attribute 'sorted'
sort()是方法,sorted()是函数,方法是调用,函数进行数据传递
a = ['ab','fg','cg']
print(sorted(a))