python 获取最大值

code

# 最简单的
print(max(1, 2))
print(max('a', 'b'))
# 也可以对列表和元组使用
print(max([1,2]))
print(max((1,2)))
# 更多实例
print("80, 100, 1000 最大值为: ", max(80, 100, 1000))
print("-20, 100, 400最大值为: ", max(-20, 100, 400))
print("-80, -20, -10最大值为: ", max(-80, -20, -10))
print("0, 100, -400最大值为:", max(0, 100, -400))

原文地址:https://www.cnblogs.com/sea-stream/p/12822069.html