Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

question: 4 what is the value of num after this code runs? shapes = \tr…

Question

question: 4
what is the value of num after this code runs?
shapes = \triangle\, \square\, \hexagon\, \circle\, \pentagon\
num = len(shapes)
options: 0, 4, 5, 35

Explanation:

Step1: Count elements in shapes list

The list shapes has 5 elements: "triangle", "square", "hexagon", "circle", "pentagon".

Step2: Assign length to num

The len() function returns the number of elements, so num = 5.

Answer:

5