预期输出:report_exam_avg(100,95,80)== '你的平均得分:91.7'返回没有元组的平均值?
def report_exam_avg(a, b, c):
assert is_number(a) and is_number(b) and is_number(c)
a = float(a)
b = float(b)
c = float(c)
mean = (a + b + c)/3.0
mean = round(mean,1)
x = 'Your average score: ', mean
return x
实际输出:( '您的平均得分:',91.7)
注意:倾斜解压如下面的元组,因为我需要返回的句子没有打印
avg, score = report_exam_avg(100, 95, 80)
print(avg, score)
'X = '你的平均得分:' + STR(平均)' – Julien
X ='你的平均分数:%s',意思是;打印(平均分数) –