fork download
  1. # your code goes here
  2. stu_height = [172, 165, 180, 158, 176, 149, 163, 155, 168, 185, 142, 170]
  3. sum_height=0
  4. for height in stu_height:
  5. sum_height+=height
  6. average_height=sum_height / len(stu_height)
  7. print(f'总成绩为:{sum_height},平均成绩为:{ average_height}')
Success #stdin #stdout 0.07s 14132KB
stdin
Standard input is empty
stdout
总成绩为:1983,平均成绩为:165.25