1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| def Sum(a,b,c): return a+b+c,a+b+c/3.0 ''' def Aver(a,b,c): return Sum(a,b,c)/3.0 ''' a=eval(input("num1:")) b=eval(input("num2:")) c=eval(input("num3:")) print("sum=",end='') print( Sum(a,b,c)[0] )
print( Sum(a,b,c)) ''' input:num1:1 num2:2 num3:3 output:sum=(6, 4.0) '''
|