Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

What does list.sort() return?

  1. A A new sorted list
  2. B None, because it sorts in place
  3. C A tuple
  4. D The original unsorted list
Answer

None, because it sorts in place

sorted() returns a new list and leaves the original untouched. Assigning the result of list.sort() gives None, which is a common bug.

All Python MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as