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 1 out of 3 pages
Exam (elaborations)

CNIT 155 QUESTIONS AND ANSWERS

Document preview thumbnail
Preview 1 out of 3 pages

CNIT 155 QUESTIONS AND ANSWERS

Content preview

CNIT 155 QUESTIONS AND ANSWERS


t/f: Files persist across multiple runs of your program. - Answers -t

t/f: Opening a file with write access causes the contents of the file to be removed first. -
Answers -t

t/f: Passing a list as an argument passes a copy of the list. - Answers -f

t/f: The input function returns a boolean if the user types in true. - Answers -f

t/f: In python, the division operator (/) gives a float result, even if both of the numbers
are integers. - Answers -t

t/f: If is a legal python identifier. - Answers -f

Which of the following is true about readlines()?
A. readlines() will only read one line
B. readlines() will only work if the file is larger than RAM
C. readlines() will process the contents in order
D. readlines() will return a list - Answers -d

Which of the following is an error that occurs when the file cannot be retrieved by the
python program?
A. FileNotFoundError
B. IOError
C. FileError
D. Both A and B - Answers -d

Which of the following will remove the second value from the list sampleList?
A. del sampleList[1]
B. remove sampleList[1]
C. remove sampleList[2]
D. del sampleList[2] - Answers -a

Given a tuple t = (3, 6, 2, 4), which of the following will result in errors?
A. print(t[2])
B. t[0] = 5
C. print(max(t))
D. print(len(t)) - Answers -b

What is the output of the following print statement?
sampleList[10, 20, 30, 40, 50, 60]
print(sampleList[-2]) - Answers -50

Document information

Uploaded on
January 24, 2026
Number of pages
3
Written in
2025/2026
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.
GEEKA
3.8
(360)
Sold
2132
Followers
1446
Items
57752
Last sold
2 hours 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