user for an automobile service. Output the user's input
the assignment, 4.9 Warm up: Automobile service cost (python 3)
Â
Â
(1) Prompt the
user for an automobile service. Output the user's input
(2) Output the price of the requested service
My code is:
Â
autoServ = input('Enter desired auto service:n')
print('You entered:', autoServ)
Â
if autoServ == 'Oil change':
  print('Cost of',autoServ,': $35')
Â
elif autoserv == 'Tire rotation':
  print('Cost of',autoServ,': $19')
Â
elif autoServ == 'Car wash':
  print('Cost of',autoServ,': $7')
Â
else:
  print('Error: Requested service is not recognized')
Answers
Status NEW
Posted 30 Aug 2019 07:08 AM
My Price 5.00
-----------
Attachments
1567151539-p2.png
1567151539-p1.png
1567151539-p3.png
file 1567151541-Error in code.docx preview (448 words )
E-----------rro-----------r i-----------n c-----------ode-----------: -----------eli-----------f a-----------uto-----------ser-----------v =-----------= '-----------Tir-----------e r-----------ota-----------tio-----------n':----------- T-----------he -----------var-----------iab-----------le -----------aut-----------ose-----------rv -----------sho-----------uld----------- be----------- au-----------toS-----------erv-----------. -----------Exp-----------lan-----------ati-----------on:----------- C-----------omp-----------let-----------e c-----------ode----------- af-----------ter----------- co-----------rre-----------cti-----------on:----------- a-----------uto-----------Ser-----------v =----------- in-----------put-----------('E-----------nte-----------r d-----------esi-----------red----------- au-----------to -----------ser-----------vic-----------e:\-----------n')----------- p-----------rin-----------t('-----------You----------- en-----------ter-----------ed:-----------', -----------aut-----------oSe-----------rv)----------- i-----------f a-----------uto-----------Ser-----------v =-----------= '-----------Oil----------- ch-----------ang-----------e':----------- Â----------- p-----------rin-----------t('-----------Cos-----------t o-----------f',-----------aut-----------oSe-----------rv,-----------': -----------$35-----------') ----------- el-----------if -----------aut-----------oSe-----------rv -----------== -----------'Ti-----------re -----------rot-----------ati-----------on'-----------: -----------Â -----------pri-----------nt(-----------'Co-----------st -----------of'-----------,au-----------toS-----------erv-----------,':----------- $1-----------9')----------- e-----------lif----------- au-----------toS-----------erv----------- ==----------- 'C-----------ar -----------was-----------h':----------- Â----------- p-----------rin-----------t('-----------Cos-----------t o-----------f',-----------aut-----------oSe-----------rv,-----------': -----------$7'-----------)
Not Rated(0)