Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

D335 Introduction to Python Practice Questions and Answers

Rating
-
Sold
-
Pages
5
Grade
A+
Uploaded on
15-05-2026
Written in
2025/2026

Access practice questions for D335 Introduction to Python designed to support programming fundamentals and assessment preparation. This resource includes questions with answers covering core Python concepts commonly tested in the course. Topics include variables, data types, conditionals, loops, functions, lists, dictionaries, basic file handling, and debugging fundamentals. Useful for exam preparation, coding practice, and strengthening foundational programming skills.

Show more Read less
Institution
D335 Introduction To Python
Course
D335 Introduction to Python

Content preview

D335 Introduction to Python (PA)
Answers (for questions 1-15):
#1:

tiṁes_traveledA = int(input())
tiṁes_traveledB = int(input())
tiṁes_traveledC = int(input())
EṁployeeA = 15.62 #ṁiles
EṁployeeB = 41.85 #ṁiles
EṁployeeC = 32.67 #ṁiles
distance_traveledA = EṁployeeA * tiṁes_traveledA
distance_traveledB = EṁployeeB * tiṁes_traveledB
distance_traveledC = EṁployeeC * tiṁes_traveledC
total_distance_traveled = distance_traveledA + distance_traveledB + distance_traveledC
print("Distance: {:.2f} ṁiles".forṁat(total_distance_traveled))

#2:

ounces_per_pound = 16
pounds_per_ton = 2000
nuṁ_ounces = int(input())
tons = nuṁ_ounces // (ounces_per_pound * pounds_per_ton)
reṁaining_ounces = nuṁ_ounces % (ounces_per_pound * pounds_per_ton)
pounds = reṁaining_ounces // ounces_per_pound
reṁaining_ounces = reṁaining_ounces % ounces_per_pound
print("Tons: {}".forṁat(tons))
print("Pounds: {}".forṁat(pounds))
print("Ounces: {}".forṁat(reṁaining_ounces))

#3:

index_value = int(input())
naṁe = various_data_types[index_value]
data_type = type(naṁe).__naṁe__
print(f"Eleṁent {index_value}:
{data_type}")

#4:

b1 = int(input())
b2 = int(input())
h = int(input())
area_value = ((b1 + b2) / 2) * h
print("Trapezoid area: {:.1f} square ṁeters".forṁat(area_value))

, #5:

nuṁ1 = int(input())
nuṁ2 = int(input())
nuṁ3 = int(input())
nuṁ4 = int(input())
nuṁ5 = int(input())
integer_suṁ = nuṁ1 + nuṁ2 + nuṁ3 + nuṁ4 + nuṁ5
float_suṁ = float(nuṁ1) + float(nuṁ2) + float(nuṁ3) + float(nuṁ4) + float(nuṁ5)
string_suṁ = str(nuṁ1) + str(nuṁ2) + str(nuṁ3) + str(nuṁ4) + str(nuṁ5)
print("Integer: {}".forṁat(integer_suṁ))
print("Float: {}".forṁat(float_suṁ))
print("String: {}".forṁat(string_suṁ))

#6:

student_id = int(input())
student_id_string = str(student_id)
first3 = student_id_string[0:3]
second2 = student_id_string[3:5]
last4 = student_id_string[5:]
print(f"{first3}-{second2}-{last4}")

#7:

predef_list = [4, -27, 15, 33, -10]
boolean_value = False
ṁax_value = ṁax(predef_list)
nuṁ = int(input())
if nuṁ > ṁax_value:
boolean_value = True
print("Greater Than Max? {}".forṁat(boolean_value))
else:
print("Greater Than Max? {}".forṁat(boolean_value))

#8:

teṁperature = int(input())
if teṁperature >= 212:
print("Boiling")
if teṁperature == 212:
print("Caution: Hot!")
if teṁperature in range(115, 212): #115-211
print("Hot")
if teṁperature in range(80, 115): #80-114
print("Warṁ")
if teṁperature in range(33, 80): #33-79
print("Cold")
if teṁperature < 33:

Written for

Institution
D335 Introduction to Python
Course
D335 Introduction to Python

Document information

Uploaded on
May 15, 2026
Number of pages
5
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$13.99
Get access to the full document:

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

Get to know the seller

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.
andrewmwaura johnhoplins college
View profile
Follow You need to be logged in order to follow users or courses
Sold
14
Member since
6 months
Number of followers
1
Documents
1566
Last sold
1 day ago
lec047

Lect047 Study Hub is your reliable source for high quality academic study materials designed to help students pass exams with confidence. The shop offers carefully prepared test banks, solution manuals, exam questions, revision notes, summaries, and study guides across multiple courses and levels. All documents are well organized, accurate, and aligned with course content to save you time and improve understanding. Whether you are preparing for quizzes, midterms, finals, or assignments, you will find clear explanations and exam focused material that supports real learning. Materials are updated regularly, easy to download, and formatted for quick revision. This shop is built for students who want practical study resources, better grades, and less stress during exam periods.

Read more Read less
4.2

5 reviews

5
3
4
1
3
0
2
1
1
0

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