QUESTION IMAGE
Question
question: 2
what does this program print?
heights = 65, 56, 67, 48, 64
heights.sort()
heights.extend(60, 61, 62)
heights.remove(67)
print(heights)
48, 56, 64, 65, 60, 61, 62
48, 56, 60, 61, 62, 64, 65
48, 56, 64, 65, 60, 61, 62
the program will error.
Step1: Initial list and sort
Original list: [65,56,67,48,64]. After sort(): [48,56,64,65,67]
Step2: Extend the list
Add [60,61,62] to the list: [48,56,64,65,67,60,61,62]
Step3: Remove element 67
New list: [48,56,64,65,60,61,62]
Step4: Sort the final list
Final sorted list: [48,56,60,61,62,64,65]
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
[48, 56, 60, 61, 62, 64, 65]