我有一个任务,让用户输入尽可能多的分数,然后我必须计算出最小值和最大值,以及有多少人使用for循环得到这些分数。我计算了平均值和标准差:
elif user_选项==3:total = 0
for val in scores_list:
total = total + val
average = total/ len(scores_list)
print (average)
elif user_option == 2:
total = 0
for val in scores_list:
total = total + val
average = total/ len(scores_list)
diffsquared = 0
sum_diffsquared = 0
for val in scores_list:
diffsquared= (val - average)**2
sum_diffsquared= diffsquared + sum_diffsquared
stdev= sqrt((sum_diffsquared)/len(scores_list))
print(stdev)
有什么办法找到最小值和最大值吗?在