Python programming:
Test your program with an inpatient who stays 5 days in the hospital with $300 of medicine expenses and an out-patient who has medication bills of $1000.
1.
def tip(per,cost):
tipp=per*cost/100
print (tipp)
tip(18,45.89) # prints 8.2602
2
a=input("Enter i for in_patient o for out_patient: ")
def in_patient():
d=int(input("Enter number of days spent in the
hospital:"))
m=int(input("Enter medication charges:"))
lab=100
total=d*250+m+lab
print('$',total)
def out_patient():
m=int(input("Enter medication charges:"))
lab=100
total=m+lab
print('$',total)
if (a=='i'):
in_patient()
elif (a=='o'):
out_patient()
else:
print ("Invalid input")
Get Answers For Free
Most questions answered within 1 hours.