# Enter the elements with spaces to store in List
list1 = input('Enter list elements: ').split(' ')
sample = [int(i) for i in list1]
total = 0
avg = 0
for j in sample:
print(j)
total = total+j
print('The Total of Sample is: ', total)
n = len(sample)
avg = total/n
print('The Average of the Sample is: ', avg)
Input:
Enter list elements: 10 20 30 40 50
Output:
10
20
30
40
50
The Total of Sample is: 150
The Average of the Sample is: 30.0
#--------------------------------------------------------------Thanks--------------------------------------------------------------#
No comments:
Post a Comment
Hi User, Thank You for visiting My Blog. If you wish, please share your genuine Feedback or comments only related to this Blog Posts. It is my humble request that, please do not post any Spam comments or Advertising kind of comments, which will be Ignored.