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

CNIT 155 FINAL PURDUE TEST PAPER 2026 COMPLETE SOLUTION SET

Document preview thumbnail
Preview 3 out of 28 pages

CNIT 155 FINAL PURDUE TEST PAPER 2026 COMPLETE SOLUTION SET

Content preview

CNIT 155 FINAL PURDUE TEST PAPER 2026
COMPLETE SOLUTION SET

◉ Which is an example of using the extend method to add a whole
list to the end of a list? Answer: scores = [ 85, 72, 56, 98, 84, 72]
scores.extend([55, 88, 79])


◉ What will be the result of the code below?
Names = ["William", "Scott", "Sophia"]
Names.insert (2, "Hanah") Answer: Names = ["William", "Scott",
"Hannah", "Sophia"]


◉ T or F: Append, extend, and insert return something. Answer:
False


◉ What will be the result of this code?
colors = colors.append("yellow") Answer: ERROR
colors = None


◉ What will be the result of this code?
colors.append("yellow") Answer: Changes colors to have "yellow" at
end

,◉ What will be the result of this code?
colors + primaries Answer: ERROR
Longer list will be thrown out


◉ What will be the result of this code?
colors = colors + primaries Answer: Returns a new list


◉ T or F: You can delete from a list by index. Answer: True


◉ Which is an example of deleting from a list using index? Answer:
del list[index]


◉ Deleting from a list using index... Answer: Removes the element at
position index and shifts down the following elements to fill in the
gap


◉ Which is an example of deleting a range from a list by using a
slice? Answer: del list[2 : 5]
# removes elements at positions 2, 3, and 4


◉ What does colors.remove("blue") do? Answer: Searches for the
first occurrence of "blue and deleters it

, ◉ What does the "search and destroy" method do? Answer: Searches
for and removes a specific value from a list


◉ What happens if the specific value can not be found using the
"search and destroy" method? Answer: Gives a runtime error


◉ Which is an example fo the "search and destroy" method using
del? Answer: if "blue" in colors:
pos =
colors.index("blue")
del colors[pos]


◉ What does the reverse method do to a list? Answer: Reverses the
order of a list


◉ Which is an example of using the reverse method on a list?
Answer: mylist = ["red", "green", "blue"]


mylist.reverse()


print(mylist) gives ["blue", "green", "red"]

Document information

Uploaded on
March 14, 2026
Number of pages
28
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$13.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.
GradeGalaxy
4.4
(8)
Sold
125
Followers
2
Items
43032
Last sold
3 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