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)

ENGR 102 EXAM 2 QUESTIONS WITH CORRECT ANSWERS

Rating
-
Sold
-
Pages
35
Grade
A+
Uploaded on
21-04-2026
Written in
2025/2026

ENGR 102 EXAM 2 QUESTIONS WITH CORRECT ANSWERS

Institution
ENGR 102
Course
ENGR 102

Content preview

Arrange the following mathematical operators in the correct order of operations
according to python. 1 is the first and 4 is the last.


%, +, (), **


Give this one a try later!


() ** % +




nums = [1, 1, 2, 3, 5, 8, 13]
What is the result of nums[1:5]?


Give this one a try later!


[1, 2, 3, 5]

,nums = [1, 1, 2, 3, 5, 8, 13]
What is the result of nums[3:1]?


Give this one a try later!


[] (can't go backwards)




Let Address = namedtuple('Address', ['street', 'city', 'country']). Create a new address
object house where house.street is "221B Baker Street", house.city is "London", and
house.country is "England".


Give this one a try later!


house = Address('221B Baker Street', 'London', 'England')




What type of error does the following code produce?


x=4
y = timestwo(x)
def timestwo(x):
return x * 2
print(y)


Give this one a try later!


NameError

,Write the simplest two statements that first sort my_list, then remove the largest value
element from the list, using list methods.


Give this one a try later!


my_list.sort()
my_list.pop()




Write an expression that concatenates the list feb_temps to the end of jan_temps.


Give this one a try later!


jan_temps + feb_temps




What is a ZeroDivisionError exception type?


Give this one a try later!


Divide by zero error




Create a new named tuple Dog that has the attributes name, breed, and color.


Give this one a try later!


Dog = namedtuple('Dog', ['name', 'breed', 'color'])

, What does all(my_list) provide?


Give this one a try later!


If the list contains a 0 element, all() returns False because not all elements
are non-zero, else returns True




Which expression checks if the value 10 exists in the dictionary my_dict?


Give this one a try later!


None of the above. The in operator only checks the keys of a dict, not the
values.




How do you sort my_list from highest to lowest and then print the reversed list?


Give this one a try later!


for i in reversed(sorted(my_list)):
print(i)




Write the simplest expression that captures the desired comparison.
The character 'G' exists in the string my_str.


Give this one a try later!

Written for

Institution
ENGR 102
Course
ENGR 102

Document information

Uploaded on
April 21, 2026
Number of pages
35
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$10.50
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
EXAMROOM
5.0
(1)

Also available in package deal

Get to know the seller

Seller avatar
EXAMROOM Boston University
Follow You need to be logged in order to follow users or courses
Sold
7
Member since
3 months
Number of followers
0
Documents
2587
Last sold
6 days ago

5.0

1 reviews

5
1
4
0
3
0
2
0
1
0

Recently viewed by you

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