-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay8.py
More file actions
25 lines (19 loc) · 745 Bytes
/
Day8.py
File metadata and controls
25 lines (19 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# On a certain day, the nurses at a hosppital worked the following number of hours: Nurse Howard worked 8 hours; Nurse Pease worked 10 hours;
# Nurse Campbell worked 9 hours; Nurse Grace worked 8 hours; Nurse McCarthy worked 7 hours, and Nurse Murphy worked 12 hours. What is the average
# number of hours worked per nurse on this day?
# Average should be as a float value.
# Solution:
def avgWork(a,b,c,d,e,f,nCount):
totalHrs = float(a+b+c+d+e+f)
temp = float(totalHrs + nCount)
avgHrs = totalHrs/nCount
return avgHrs
nHoward = 8
nPease = 10
nCampbell = 9
nGrace = 8
nMcCarthy = 7
nMurphy = 12
nurseCount = 6
avghours = avgWork(nHoward,nPease,nCampbell,nGrace,nMcCarthy,nMurphy,nurseCount)
print("Average Hours is", avghours)