定义一个名为calc的函数,函数的功能是,接收3个数字,
分别计算它们的和与乘积,把结果存储在元组中返回
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
@author: Roc-xb
"""
def calc(a: int, b: int, c: int):
d = a + b + c
e = a * b * c
return (d, e)
if __name__ == '__main__':
print(calc(1, 2, 3))
你题目的解答代码如下:(如有帮助,望采纳!谢谢! 点击我这个回答右上方的【采纳】按钮)
def calc(n1,n2,n3):
return (n1+n2+n3 , n1*n2*n3)
print(calc(3,2,9))
有帮助望采纳
def calc(int1,int2,int3):
result=(int1+int2+int3,int1*int2*int3)
return result
def calc(a, b, c):
s = a + b + c
l = a * b * c
m = (s, l)
print(m)
return m
calc(2, 3, 5)
def calc(a,b,c):
return a+b+c,a*b*c
问点有难度的,都不想回答这种低级问题