Purdue CNIT 155 Final Exam (Python)
2025/2026 Exam Questions and Answers
| 100% Pass
What is a List? - 🧠 ANSWER ✔✔A data structure that can store many values of
under one name
Which is an example of how to create an empty list? - 🧠 ANSWER ✔✔Variable =
[]
Variable = list()
Which is an example of how to create a list with predefined values? - 🧠 ANSWER
✔✔colors = ["red, "yellow", "blue"]
To create a list with predefined values, you have to.... - 🧠 ANSWER ✔✔Put a
sequence of items in []
What does list1.append(elem) do? - 🧠 ANSWER ✔✔Adds a single element to the
end of the list
COPYRIGHT©NINJANERD 2025/2026. YEAR PUBLISHED 2025. COMPANY REGISTRATION NUMBER: 619652435.
TERMS OF USE. PRIVACY STATEMENT. ALL RIGHTS RESERVED 1
,What does list1.insert(index, elem) do? - 🧠 ANSWER ✔✔Inserts the element elem
at the given index, shifting elements to the right
What does list1.extend(list2) do? - 🧠 ANSWER ✔✔Add the elements in list2 to the
end of the list.
T or F: The extend method is not only used with a list. - 🧠 ANSWER ✔✔False
T or F: Using + or += on a list is similar to using the extend method. - 🧠 ANSWER
✔✔True
How do you access the individual element in a list using an index? - 🧠 ANSWER
✔✔list1[index]
What are characteristics of Positive Indexes? - 🧠 ANSWER ✔✔First element in the
list has index 0, second element has index 1, and n'th element is n-1
What are characteristics of Negative Indexes? - 🧠 ANSWER ✔✔Identify positions
relative to the end of the list, index -1 identifies the last element, and -2 identifies
the next to last element, etc.
What does Function do? - 🧠 ANSWER ✔✔Is a description
What does len do? - 🧠 ANSWER ✔✔Returns the number of items in the list
COPYRIGHT©NINJANERD 2025/2026. YEAR PUBLISHED 2025. COMPANY REGISTRATION NUMBER: 619652435.
TERMS OF USE. PRIVACY STATEMENT. ALL RIGHTS RESERVED 2
,What does min do? - 🧠 ANSWER ✔✔Returns the minimum among the elements in
the list
What does max do? - 🧠 ANSWER ✔✔Returns the maximum among the elements
in the list
What does sum do? - 🧠 ANSWER ✔✔Returns the sum of all the elements in the
list. (applies to list of numerical values only)
Given a list, you may use ________ to randomize the order of the elements in a
list. - 🧠 ANSWER ✔✔Shuffle
What do you type to import the shuffle function and use the shuffle function with a
list? - 🧠 ANSWER ✔✔from random import shuffle
shuffle(list1)
You can refer to elements of a list using the... - 🧠 ANSWER ✔✔Subscript syntax
T or F: The code below makes third have a value of 83.0
scores = [75.0, 68.5, 83.0]
third = scores[2] - 🧠 ANSWER ✔✔True
COPYRIGHT©NINJANERD 2025/2026. YEAR PUBLISHED 2025. COMPANY REGISTRATION NUMBER: 619652435.
TERMS OF USE. PRIVACY STATEMENT. ALL RIGHTS RESERVED 3
, T or F: Negative indices count from the right end. - 🧠 ANSWER ✔✔True
What is the value of third after running the code below?
scores = [75.0, 68.5, 83.0]
third = scores[-1] - 🧠 ANSWER ✔✔83.0
Which is an example of negative indices? - 🧠 ANSWER ✔✔scores = [75.0, 68.5,
83.0]
third = scores[-1]
Which is an example of positive indices? - 🧠 ANSWER ✔✔scores = [75.0, 68.5,
83.0]
third = scores[2]
Slicing gives a... - 🧠 ANSWER ✔✔List of elements
Subscripting gives a... - 🧠 ANSWER ✔✔Single element
Which is an example of slicing a list? - 🧠 ANSWER ✔✔scores = [68.5, 83.0]
exams = scores[1:3]
T or F: Each list is an object. - 🧠 ANSWER ✔✔True
COPYRIGHT©NINJANERD 2025/2026. YEAR PUBLISHED 2025. COMPANY REGISTRATION NUMBER: 619652435.
TERMS OF USE. PRIVACY STATEMENT. ALL RIGHTS RESERVED 4
2025/2026 Exam Questions and Answers
| 100% Pass
What is a List? - 🧠 ANSWER ✔✔A data structure that can store many values of
under one name
Which is an example of how to create an empty list? - 🧠 ANSWER ✔✔Variable =
[]
Variable = list()
Which is an example of how to create a list with predefined values? - 🧠 ANSWER
✔✔colors = ["red, "yellow", "blue"]
To create a list with predefined values, you have to.... - 🧠 ANSWER ✔✔Put a
sequence of items in []
What does list1.append(elem) do? - 🧠 ANSWER ✔✔Adds a single element to the
end of the list
COPYRIGHT©NINJANERD 2025/2026. YEAR PUBLISHED 2025. COMPANY REGISTRATION NUMBER: 619652435.
TERMS OF USE. PRIVACY STATEMENT. ALL RIGHTS RESERVED 1
,What does list1.insert(index, elem) do? - 🧠 ANSWER ✔✔Inserts the element elem
at the given index, shifting elements to the right
What does list1.extend(list2) do? - 🧠 ANSWER ✔✔Add the elements in list2 to the
end of the list.
T or F: The extend method is not only used with a list. - 🧠 ANSWER ✔✔False
T or F: Using + or += on a list is similar to using the extend method. - 🧠 ANSWER
✔✔True
How do you access the individual element in a list using an index? - 🧠 ANSWER
✔✔list1[index]
What are characteristics of Positive Indexes? - 🧠 ANSWER ✔✔First element in the
list has index 0, second element has index 1, and n'th element is n-1
What are characteristics of Negative Indexes? - 🧠 ANSWER ✔✔Identify positions
relative to the end of the list, index -1 identifies the last element, and -2 identifies
the next to last element, etc.
What does Function do? - 🧠 ANSWER ✔✔Is a description
What does len do? - 🧠 ANSWER ✔✔Returns the number of items in the list
COPYRIGHT©NINJANERD 2025/2026. YEAR PUBLISHED 2025. COMPANY REGISTRATION NUMBER: 619652435.
TERMS OF USE. PRIVACY STATEMENT. ALL RIGHTS RESERVED 2
,What does min do? - 🧠 ANSWER ✔✔Returns the minimum among the elements in
the list
What does max do? - 🧠 ANSWER ✔✔Returns the maximum among the elements
in the list
What does sum do? - 🧠 ANSWER ✔✔Returns the sum of all the elements in the
list. (applies to list of numerical values only)
Given a list, you may use ________ to randomize the order of the elements in a
list. - 🧠 ANSWER ✔✔Shuffle
What do you type to import the shuffle function and use the shuffle function with a
list? - 🧠 ANSWER ✔✔from random import shuffle
shuffle(list1)
You can refer to elements of a list using the... - 🧠 ANSWER ✔✔Subscript syntax
T or F: The code below makes third have a value of 83.0
scores = [75.0, 68.5, 83.0]
third = scores[2] - 🧠 ANSWER ✔✔True
COPYRIGHT©NINJANERD 2025/2026. YEAR PUBLISHED 2025. COMPANY REGISTRATION NUMBER: 619652435.
TERMS OF USE. PRIVACY STATEMENT. ALL RIGHTS RESERVED 3
, T or F: Negative indices count from the right end. - 🧠 ANSWER ✔✔True
What is the value of third after running the code below?
scores = [75.0, 68.5, 83.0]
third = scores[-1] - 🧠 ANSWER ✔✔83.0
Which is an example of negative indices? - 🧠 ANSWER ✔✔scores = [75.0, 68.5,
83.0]
third = scores[-1]
Which is an example of positive indices? - 🧠 ANSWER ✔✔scores = [75.0, 68.5,
83.0]
third = scores[2]
Slicing gives a... - 🧠 ANSWER ✔✔List of elements
Subscripting gives a... - 🧠 ANSWER ✔✔Single element
Which is an example of slicing a list? - 🧠 ANSWER ✔✔scores = [68.5, 83.0]
exams = scores[1:3]
T or F: Each list is an object. - 🧠 ANSWER ✔✔True
COPYRIGHT©NINJANERD 2025/2026. YEAR PUBLISHED 2025. COMPANY REGISTRATION NUMBER: 619652435.
TERMS OF USE. PRIVACY STATEMENT. ALL RIGHTS RESERVED 4