Frage im Vorstellungsgespräch bei RBC Investor Services

Bubble Sorting algorithm in Python? How can you optimize the code?