• 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 6 pages
Exam (elaborations)

D335 Introduction to Programming in Python exam with correct answers

Document preview thumbnail
Preview 2 out of 6 pages

D335 Introduction to Programming in Python exam with correct answers

Content preview

D335 Introduction to Programming in ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\




Python exam with correct answers ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\




22.1 Lab: Convert to Seconds
||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\




Write a program that reads in hours, minutes, and
||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\




seconds as input, and outputs the time in seconds ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\




only.




22.2 Lab: Convert from Seconds
||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\




People find it easier to read time in hours, minutes,
||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\




and seconds rather than just seconds.
||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\




Write a program that reads in seconds as input and
||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\




outputs the time in hours, minutes, and seconds. ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\

, 22.3 Lab: Pizza Party ||\\||\\ ||\\||\\ ||\\||\\




Given the number of people attending a pizza party,
||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\




output the number of needed pizzas and total cost. ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\




For the calculation, assume that people eat 2 slices
||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\




on average and each pizza has 12 slices and costs
||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\




$14.95.




22.4 Lab: Hypotenuse ||\\||\\ ||\\||\\




Given two numbers that represent the lengths of a
||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\




right triangle's legs (sides adjacent to the right
||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\




angle), output the length of the third side (i.e. ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\




hypotenuse) with two digits after the decimal point. ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\ ||\\||\\

Document information

Uploaded on
September 24, 2026
Number of pages
6
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$24.49

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.
progrades
4.0
(2)
Sold
17
Followers
0
Items
4053
Last sold
3 weeks 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