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 9 pages
Exam (elaborations)

CNIT 155 COMPREHENSIVE 2026 EXAM QUESTIONS AND SOLUTIONS RATED

Document preview thumbnail
Preview 2 out of 9 pages

CNIT 155 COMPREHENSIVE 2026 EXAM QUESTIONS AND SOLUTIONS RATED

Content preview

CNIT 155 COMPREHENSIVE 2026 EXAM QUESTIONS AND
SOLUTIONS RATED A+
✔✔Which output will the following code produce?
color = []
color = ["blue", "green", "red"]
print(color[2]) - ✔✔red

✔✔Which of the following will randomize the order of elements in a list sampleList?
Assume that the required library has been imported correctly.
A. sort(sampleList)
B. shuffle(sampleList)
C. random(sampleList)
D. randomize(sampleList) - ✔✔B. shuffle(sampleList)

✔✔list1 = [1, 2, 3, 4]
list2 = [5, 6, 7, 8]
print ( len(list1 + list2) ) - ✔✔8

✔✔Passing a list as an argument passes a copy of the list. T/F - ✔✔False

✔✔Lists are mutable T/F - ✔✔True

✔✔The built-in function split() return a list T/F - ✔✔True

✔✔The index of the first value in a python list is 1 T/F - ✔✔False

✔✔Lists are a type of data structure that can store many values under one name T/F -
✔✔True

✔✔Analyze the following code:

count = 0
while count < 100:
#Point A
print("Welcome to Python!")
count += 1
#Point B
#Point C

A. count < 100 is always True at point c
B. count < 100 is always True at point b
C. All answers are False
D. count < 100 is always True at point A - ✔✔B. count < 100 is always True at point A

, ✔✔While loops are pretest loops T/F - ✔✔True

✔✔In Python, the division operator (/) gives a float result, even if both of the numbers
are integers T/F - ✔✔True

✔✔What is the output of the following code?

n = 20
while (n <= 25):
print(n,"\n")
n = n+1 - ✔✔20,21,22,23,24,25

✔✔If we want score to be a random number in the range of [10.0, 50.0), which
statement would be correct (assuming the random library has been imported)?

A. score = 40.0 * random + 10.0
B. score = 50.0 * random + 10.0
C. score = 10.0 * random + 40.0
D. score = random() + 50.0 - ✔✔A. score = 40.0 * random + 10.0

✔✔The expression 3 ** 3 - (6-2)/2 has the value _____. Is it an integer or a float value?
__________________.

A. 7, int
B. 25, float
C. 7, float
D. 25, int - ✔✔B. 25, float

✔✔Suppose you're given a list of words, intList. Write Python code that will print one
line for each number, repeating that number twice. For example, if intList is [60, 70, 80,
90], then your code would print:
60 60
70 70
80 80
90 90 - ✔✔def main():
intList = [60, 70, 80, 90]
for i in range(0, len(intList)):
print(intList[i], " ", intList[i], "\n")
i += 1
main()

✔✔Write a Python program to check if the letter 'e' is in a given string:

Example:

Document information

Uploaded on
April 16, 2026
Number of pages
9
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$12.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.
BOARDWALK
3.5
(40)
Sold
276
Followers
8
Items
32861
Last sold
6 days 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