Write a program to read n numbers from users and calculate the average of those n numbers in python
Code
n = int(input("Enter the number of numbers: "))sum = 0for i in range(n):sum += int(input("Enter a number: "))print("The average is", sum/n)
Write a program to read n numbers from users and calculate the average of those n numbers in python
n = int(input("Enter the number of numbers: "))sum = 0for i in range(n):sum += int(input("Enter a number: "))print("The average is", sum/n)
0 Comments
Post a Comment