174k views
8 votes
Which line of code will sort the list.

aList = [9, 2, 3.5, 2]

aList.sort()

aList(order)

sort(aList)

order(aList)

1 Answer

6 votes

Answer:

aList.sort()

Step-by-step explanation:

Given

List: aList

Required

instruction to sort the list

The given code segment is written in Python.

In python, to sort a list; you make use of

[list-name].sort()

So, in this case, the line of code to sort aList is aList.sort()

User IPherian
by
7.0k points