+ 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
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
+ 1
Thx sir😇