QUESTION IMAGE
Question
what will you see on the next line?
>> alist = 9, 2, 3.5, 7
>> alist.sort()
>> alist
Step1: Understand list.sort() method
The sort() method in Python sorts the elements of the list in - place.
Step2: Identify initial list elements
The initial list aList = [9, 2, 3.5, 7].
Step3: Determine sorted list
After calling aList.sort(), the elements will be sorted in ascending order. So the sorted list is [2, 3.5, 7, 9].
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
[2, 3.5, 7, 9]