求三个元素的最大值,和最小值。
a = 5 b = 6 c = 1 def max_num(): re = (a if a>b else b)if(a if a>b else b)>c else c rt = (a if a<b else b)if(a if a<b else b)<c else c return re,rt l = max_num() print(l)
a = 5 b = 6 c = 1 def max_num(): re = (a if a>b else b)if(a if a>b else b)>c else c rt = (a if a<b else b)if(a if a<b else b)<c else c return re,rt l = max_num() print(l)