+ 2

What is wrong with this code #calculating Mean value

There is some problem in #total_number Please explain 😲 https://code.sololearn.com/cO4lK1SsgG66/?ref=app

8th May 2019, 4:26 PM
Arpit Kumar
3 Réponses
+ 2
print ("This programe is to calculate the mean value") n = input("How many numbers are there ") n = int (n) number = [int(i) for i in input().split(" ")] total_number = 0 for num in range(n): total_number += number[num] average = total_number/n print(average) alternatively, you could use use mean() from statistics from statistics import mean
8th May 2019, 4:35 PM
Choe
Choe - avatar
+ 1
Thx sir😇
8th May 2019, 4:35 PM
Arpit Kumar