Skip to content

Commit e10dfd3

Browse files
authored
Merge pull request #60 from PdxCodeGuild/muki-lab01-average-numbers
Muki lab01 average numbers
2 parents 12ac222 + b2237cb commit e10dfd3

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

code/muki/lab01.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Lab 01, Will "Muki" Shelnutt
2+
3+
# Version 1
4+
# using given list for nums = [5, ,0, 8, 3, 4, 1, 6]
5+
# thoughts are to run some loops and print sum functions with some math going on
6+
# i will try to define a function that will do this stuff and use that for version 2
7+
8+
from importlib.abc import MetaPathFinder
9+
from string import ascii_letters
10+
11+
'''
12+
numbahs = [5, 0, 8, 3, 4, 1, 6]
13+
print(numbahs)
14+
print('\n') # trying to make this a little easier to identify when printed
15+
16+
for numbah in numbahs:
17+
print(numbah)
18+
print('\n') # trying to make this a little easier to identify when printed
19+
20+
for i in range(len(numbahs)):
21+
print(numbahs[i])
22+
print('\n') # trying to make this a little easier to identify when printed
23+
print(sum(numbahs)/len(numbahs))
24+
'''
25+
'''
26+
def mean_from_input(total, pieces,):
27+
total = sum(total)
28+
pieces = len(total)
29+
meanie = total / pieces
30+
return meanie
31+
'''
32+
'''
33+
# Version 2
34+
days = input('How many are there?\t')
35+
days = int(days)
36+
months = input('How many groups should there be?\t')
37+
months = int(months)
38+
print(f'The average number of days in a month is: {mean_from_input(days, months)}')
39+
'''
40+
'''numbaahs = []
41+
while True:
42+
n_entry = input("Please enter a number:\t")
43+
numbaahs.append(n_entry)
44+
print(numbaahs)
45+
'''
46+
47+
digits = []
48+
while True:
49+
new_dig = input('please enter an integer or type "q" to quit:\t')
50+
if new_dig == 'q':
51+
break
52+
new_dig = int(new_dig)
53+
digits.append(new_dig)
54+
av = sum((digits))/len(digits)
55+
print(f'So, the values that you entered were calculated to have an average of: {av}')
56+
57+
58+
59+

0 commit comments

Comments
 (0)