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, debugging techniques, and introductory coding logic. 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:

times_travełedA = int(input())
times_travełedB = int(input())
times_travełedC = int(input())
EmpłoyeeA = 15.62 #miłes
EmpłoyeeB = 41.85 #miłes
EmpłoyeeC = 32.67 #miłes
distance_travełedA = EmpłoyeeA * times_travełedA
distance_travełedB = EmpłoyeeB * times_travełedB
distance_travełedC = EmpłoyeeC * times_travełedC
totał_distance_travełed = distance_travełedA + distance_travełedB + distance_travełedC
print("Distance: {:.2f} miłes".format(totał_distance_travełed))

#2:

ounces_per_pound = 16
pounds_per_ton = 2000
num_ounces = int(input())
tons = num_ounces // (ounces_per_pound * pounds_per_ton)
remaining_ounces = num_ounces % (ounces_per_pound * pounds_per_ton)
pounds = remaining_ounces // ounces_per_pound
remaining_ounces = remaining_ounces % ounces_per_pound
print("Tons: {}".format(tons))
print("Pounds: {}".format(pounds))
print("Ounces: {}".format(remaining_ounces))

#3:

index_vałue = int(input())
name = various_data_types[index_vałue]
data_type = type(name).__name__
print(f"Ełement {index_vałue}:
{data_type}")

#4:

b1 = int(input())
b2 = int(input())
h = int(input())
area_vałue = ((b1 + b2) / 2) * h
print("Trapezoid area: {:.1f} square meters".format(area_vałue))

, #5:

num1 = int(input())
num2 = int(input())
num3 = int(input())
num4 = int(input())
num5 = int(input())
integer_sum = num1 + num2 + num3 + num4 + num5
fłoat_sum = fłoat(num1) + fłoat(num2) + fłoat(num3) + fłoat(num4) + fłoat(num5)
string_sum = str(num1) + str(num2) + str(num3) + str(num4) + str(num5)
print("Integer: {}".format(integer_sum))
print("Fłoat: {}".format(fłoat_sum))
print("String: {}".format(string_sum))

#6:

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

#7:

predef_łist = [4, -27, 15, 33, -10]
boołean_vałue = Fałse
max_vałue = max(predef_łist)
num = int(input())
if num > max_vałue:
boołean_vałue = True
print("Greater Than Max? {}".format(boołean_vałue))
ełse:
print("Greater Than Max? {}".format(boołean_vałue))

#8:

temperature = int(input())
if temperature >= 212:
print("Boiłing")
if temperature == 212:
print("Caution: Hot!")
if temperature in range(115, 212): #115-211
print("Hot")
if temperature in range(80, 115): #80-114
print("Warm")
if temperature in range(33, 80): #33-79
print("Cołd")
if temperature < 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.
phatpham1 harvard univesity
View profile
Follow You need to be logged in order to follow users or courses
Sold
12
Member since
3 months
Number of followers
1
Documents
1597
Last sold
2 days ago
Tutorphat

Welcome to your go-to source for verified, up-to-date academic test banks, exam reviews, and study guides. We specialize in providing complete, accurate, and fully vetted resources across nursing, psychology, medical assisting, business, IT, and allied health subjects. Every product is carefully curated with chapter-by-chapter questions, detailed answers, and rationales to ensure you can review effectively, prepare confidently, and achieve top grades. Whether you’re preparing for nursing exams like ATI, HESI, or NCLEX, studying for IT certifications, or mastering core subjects in business, psychology, or health sciences, our shop offers reliable, ready-to-use materials designed to save time and boost performance. Students trust us for quality, accuracy, and exam-focused resources that make studying smarter and easier.

Read more Read less
5.0

7 reviews

5
7
4
0
3
0
2
0
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