# ChapterArithmetic/statsMM.py
"""
his program computes mean.
Enter a number ( to quit) >> 6
Enter a number ( to quit) >> 7
Enter a number ( to quit) >> 8
Enter a number ( to quit) >>
The mean is 7.0
"""
def main():
print("Compute mean.")
xStr = input("Enter a number ( to quit) >> ")
k = 0 # counts elements
mysum = 0
while (xStr != ""):
x = float(xStr)
mysum = mysum + x
k = k + 1
xStr = input("Enter a number ( to quit) >> ")
print("\nThe mean is", mysum/k)
main()