We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dd755ab commit fcf6f12Copy full SHA for fcf6f12
averageMachine
@@ -0,0 +1,28 @@
1
+# Create a program that prints an average for a set of
2
+# numbers:
3
+
4
+# First, ask the user for how many numbers he would like
5
+# to enter.
6
7
+# Then ask him to input each number
8
9
+# Then calculate the average and print it
10
11
+print('Welcome to my average machine!')
12
+print('Enter in how many numbers you would like to average')
13
+print('n: ')
14
15
+n = int(input())
16
17
+totalSum = 0
18
19
+for i in range(n):
20
+ print('Please enter a number: ')
21
+ usrInput = int(input())
22
+ totalSum = totalSum + usrInput
23
24
+# totalSum is now all of the numbers added together
25
26
+average = totalSum / n
27
28
+print('Your average is: ' + str(average))
0 commit comments