With Answers
Create nha nhsolution nhthat nhaccepts nhthree nhinteger nhinputs nhrepresenting nhthe nhnumber nhof
nhtimes nhan nhemployee nhtravels nhto nha nhjob nhsite. nhOutput nhthe nhtotal nhdistance nhtraveled nhto
nhtwo nhdecimal nhplaces nhgiven nhthe nhfollowing nhmiles nhper nhemployee nhcommute nhto nhthe nhjob
nhsite. nhOutput nhthe nhtotal nhdistance nhtraveled nhto nhtwo nhdecimal nhplaces nhgiven nhthe nhfollowing
nhmiles nhper nhemployee nhcommute nhto nhthe nhjob nhsite:
Employee nhA: nh15.62 nhmiles
Employee nhB: nh41.85 nhmiles
Employee nhC: nh32.67 nhmiles
, The nhsolution nhoutput nhshould nhbe nhin nhthe nhformat
Distance: nhtotal_miles_traveled nh- nh nhcorrect nhanswer- nhcommute nh= nh{
nh'Employee nhA': nh15.62, nh
nh'Employee nhB': nh41.85, nh
nh'Employee nhC': nh32.67
}
travels nh= nh{
nh'Employee nhA': nhint(input()), nh
nh'Employee nhB': nhint(input()), nh
nh'Employee nhC': nhint(input())
}
t_d_t nh= nhsum(commute[employee]*travels[employee] nhfor nhemployee nhin nhtravels)
print(f'Distance: nh{t_d_t:.2f} nhmiles')
Create nha nhPython nhsolution nhto nhthe nhfollowing nhtask. nhEnsure nhthat nhthe nhsolution nhproduces
nhoutput nhin nhexactly nhthe nhsame nhformat nhshown nhin nhthe nhsample(s) nhbelow, nhincluding
nhcapitalization nhand nhwhitespace.
Task:
Create nha nhsolution nhthat nhaccepts nhan nhinteger nhinput nhrepresenting nhany nhnumber nhof nhounces.
nhOutput nhthe nhconverted nhtotal nhnumber nhof nhtons, nhpounds, nhand nhremaining nhounces nhbased
nhon nhthe nhinput nhounces nhvalue. nhThere nhare nh16 nhounces nhin nha nhpound nhand nh2,000 nhpounds
nhin nha nhton.
The nhsolution nhoutput nhshould nhbe nhin nhthe nhformat
Tons: nhvalue_1 nhPounds: nhvalue_2 nhOunces: nhvalue_3 nh- nh nhcorrect nhanswer- nhopp nh= nh16
top nh= nh2000
ounces nh= nhint(input())