Predict

Sort Surprise

Lists have a .sort() method and there's a sorted() function. Do they behave the same?

loot = [3, 1, 2]
ordered = loot.sort()
backwards = sorted(loot, reverse=True)
print(ordered, loot, backwards)

What does this program print?