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
Document preview thumbnail
Preview 2 out of 5 pages
Exam (elaborations)

COMP 110 Test2– Complete Questions with 100% Correct Answers | Verified

Document preview thumbnail
Preview 2 out of 5 pages

COMP 110 Test2– Complete Questions with 100% Correct Answers | Verified

Content preview

COMP 110 Test2– Complete Questions with 100%
Correct Answers | Verified
Every individual character in a str has a corresponding int value.

True or False - ✔✔True


How many digits are there in hexidecimal ("hex") numbers?

Choice 1 of 4:2Choice 2 of 4:8Choice 3 of 4:10Choice 4 of 4:16 - ✔✔16


The largest hex digit is F. What is its value in the decimal system?
Choice 1 of 5:6Choice 2 of 5:9Choice 3 of 5:14Choice 4 of 5:15Choice 5 of 5:16 -
✔✔15


The following string uses an escape sequence that causes it to span multiple lines when
printed?
"Hello\nworld\n!!!"

True or False - ✔✔True


Your computer knows when you write an infinite loop in your program and will not run
your program if it sees it is doing pointless, endless work on your behalf.

True or False - ✔✔False


Function calls are expressions that evaluate to a specific data type.

True or False - ✔✔True


In a memory diagram, if I encounter the line y: list[int] = x, where x is an already defined
list[int], what should I write next to y on the stack?

, Choice 1 of 3:The id of the object on the heap x is a reference toChoice 2 of 3:A copy of
all of the elements of xChoice 3 of 3:An id to a new object on the heap that is a copy of x
- ✔✔Choice 1 of 3: The id of the object on the heap x is a reference to


Which syntax will import the function named powerful from the module named helpers
contained in the package named lessons?
Choice 1 of 3:import powerful from lessons.helpersChoice 2 of 3:from lessons.helpers
import powerfulChoice 3 of 3:from powerful import lessons.helpers - ✔✔from
lessons.helpers import powerful


For the following examples, you'll be importing the following module named a
contained in the package named b:
def double(x: int) -> int: return x * 2 def double_display(y: int): print(y * 2)
double_display(2) if __name__ == "__main__": print(double(3))
Say we defined the module module named c contained in the package named b in the
following way:
from b.a import double, double_display print(double(1)) double_display(4)
What is the output after running python -m b.c?
Choice 1 of 5:2, 8 (With commas representing a new line.)Choice 2 of 5:2, 4, 8 (With
commas representing a new line.)Choice 3 of 5:4, 2, 8 (With commas representing a
new line.)Choice 4 of 5:NoneChoice 5 of 5:Error - ✔✔4, 2, 8


You can directly and efficiently lookup a key by its value in a dictionary.

True or False - ✔✔False


Dictionary objects are stored in which part of memory?

Choice 1 of 2:stackChoice 2 of 2:heap - ✔✔heap

Document information

Uploaded on
January 4, 2025
Number of pages
5
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$11.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.
QUINTER
3.6
(73)
Sold
410
Followers
105
Items
39956
Last sold
2 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