Information about cookies on this page

Our website uses cookies to ensure the functionality of the website, to collect and analyze information about the performance and usage of the website. Privacy Policy

  • Courses
    • Discord
    • Twitter
    • Linkedin
    • Facebook
    • Instagram
  • Pricing
  • English
  • Čeština
  • Deutsch
  • Русский
Sign inStart free
  • Courses
  • Pricing

Community

Sign in
  
  • Courses
    • Discord
    • Twitter
    • Linkedin
    • Facebook
    • Instagram
  • Pricing
  • English
  • Čeština
  • Deutsch
  • Русский
Sign inStart free
  • Courses
  • Pricing

Community

Sign in

Quiz: sort() or sorted()?

What does this program print?

1numbers = [3, 1, 2]
2sorted(numbers)
3print(numbers)
4numbers.sort()
5print(numbers)
Back

3/9

  1. 1. Sorting with sorted()
  2. 2. The .sort() Method
  3. 3. Quiz: sort() or sorted()?
  4. 4. From the Largest
  5. 5. Sorting by Another Rule
  6. 6. Your Own Key
  7. 7. Quiz: Sorting
  8. 8. min() and max() with key
  9. 9. Summary
Next

Try it yourself

Do this exercise right here in your browser. No account needed.