Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Given the following list, what is the value of ages[5] ? ages = [22, 35, 24, 17,

ID: 3910869 • Letter: G

Question

Given the following list, what is the value of ages[5]?


ages = [22, 35, 24, 17, 28]

Flag this Question

Question 21 pts

Given the following list, what is the value of names[2]?

names = ["Lizzy", "Mike", "Joel", "Anne", "Donald Duck"]

Flag this Question

Question 31 pts

Given the following code, what would the list consist of after the second statement?

ages = [22, 35, 24, 17, 28]
ages.insert(3, 4)

Flag this Question

Question 41 pts

The __________ method adds an item to the end of a list.

Flag this Question

Question 51 pts

The primary difference between a tuple and a list is that a tuple

Flag this Question

Question 61 pts

To refer to an item in a list, you code the list name followed by

Flag this Question

Question 71 pts

When a function changes the data in a list, the changed list

Flag this Question

Question 81 pts

Which of the following is not true about a list of lists?

Flag this Question

Question 91 pts

Which of the following would create a list named numbers
consisting of 3 floating-point items?

Flag this Question

Question 101 pts

Which of the following creates a tuple of six strings?

22

Explanation / Answer

Given the following list, what is the value of ages[5]?
ages = [22, 35, 24, 17, 28]
Answer : None: Index error
explanation : because list contains only 5 items...max index would be 4..hence error

Question 21 pts
Given the following list, what is the value of names[2]?
names = ["Lizzy", "Mike", "Joel", "Anne", "Donald Duck"]
Answer:Joel
explanation: list index starts from 0

Question 31 pts
Given the following code, what would the list consist of after the second statement?
ages = [22, 35, 24, 17, 28]
ages.insert(3, 4)
answer:ages = [22, 35, 24, 4, 17, 28]
explanation : inserts item at index 3

Question 41 pts
The __________ method adds an item to the end of a list.
Answer: append()

Question 51 pts
The primary difference between a tuple and a list is that a tuple
Answer: is immutable


Question 61 pts
To refer to an item in a list, you code the list name followed by
Answer: an index number in brackets, starting with the number 0

Question 71 pts
When a function changes the data in a list, the changed list
Answer:is only available within that function.

Question 81 pts
Which of the following is not true about a list of lists?
Answer: To delete an item in the outer list, you first have to delete the list in the item.

Question 91 pts
Which of the following would create a list named numbers
consisting of 3 floating-point items?
Answer:numbers = [5.3, 4.8, 6.7]

Question 101 pts
Which of the following creates a tuple of six strings?
Answer:vehicles = ("sedan","SUV","motorcycle","bicycle","hatchback","truck")

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote