• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 11 pages
Exam (elaborations)

Intro To Python (OA) Practice Questions With Answers

Document preview thumbnail
Preview 2 out of 11 pages

Intro To Python (OA) Practice Questions With Answers

Content preview

Intro To Python (OA) Practice Questions
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())

Document information

Uploaded on
March 27, 2025
Number of pages
11
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$12.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Edufiles
4.9
(217)
Sold
147
Followers
10
Items
7463
Last sold
4 days ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions