list = [1,100,30,29,70]
# 使用sorted,没有返回值,生成新的列表
d = sorted(list)
print(d)
# 使用sort,有返回值,返回排序后的列表
list.sort()
print(list)
#反转
list.reverse()
print(list)
输出
python定义变量的方式
a,b,c = 10,20,30
print(a,b,c)
输出
list = [1,100,30,29,70]
# 使用sorted,没有返回值,生成新的列表
d = sorted(list)
print(d)
# 使用sort,有返回值,返回排序后的列表
list.sort()
print(list)
#反转
list.reverse()
print(list)
输出
python定义变量的方式
a,b,c = 10,20,30
print(a,b,c)
输出