题解 | #计算题目难度#
计算题目难度
https://www.nowcoder.com/practice/76ae981719834b92b877bdc9ac6d38f3
def difficulty(grade_list): sum=0 c=0 for i in range(len(grade_list)): sum+=grade_list[i] if grade_list[i]==100: # 记录满分数 c+=1 # 平均分 avg=sum/len(grade_list) # 难度 dif=avg/c return dif n=list(map(int,input().split())) # 调用函数 diff=difficulty(n) print('%.1f'%diff)