24
QuizMultiple Choice

Use Data Structures — Cumulative exam

Question 24 • Introduction to Information Technology - EL3701

What does the program print out as a result of the given snippet of code?supplies = ["pencil", "notebook", "backpack", "calculator", "pen"]print(len(supplies))

Answer
A
5
B
8
C
[‘backpack’, ‘calculator’, ‘notebook’, ‘pen’, ‘pencil’]
D
[‘pencil’, ‘notebook’, ‘backpack’, ‘calculator’, ‘pen’]

Explanation

The list contains five items: pencil, notebook, backpack, calculator, and pen. The len() function returns the number of items in a list, so the program prints 5, which is choice A.

AI-written and checked against the verified answer.

Previous
Next