QUESTION IMAGE
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
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.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
5