Differences Between sorted() and sort() in Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ส.ค. 2023
  • In this video we break down the nuances between the built-in function sorted() and the list method sort(), their benefits, and when you might choose one over the other 💡
    Whether you're a beginner or just need a refresher, this will help you grasp the distinctions. Don't forget to subscribe for more weekly Python and developer tips & tricks 🐍
    ---
    Learn more about Pybites / what we do: pybit.es
    Get our weekly developer / mindset emails: pybit.es/friends/
    Join our Slack community: pybit.es/community/
    And last but not least, we appreciate any feedback to make our TH-cam content better 💡
    form.jotform.com/230941798741062 🙏
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 5

  • @Pybites
    @Pybites  10 หลายเดือนก่อน +2

    For more built-in functions, check out this video:
    Useful Python Built-in Functions [Beginner / Intermediate]
    th-cam.com/video/ejvql4eKev4/w-d-xo.html

  • @xianmariano6422
    @xianmariano6422 6 หลายเดือนก่อน +1

    very helpful thank you

    • @Pybites
      @Pybites  6 หลายเดือนก่อน

      thanks

  • @bubblebath2892
    @bubblebath2892 2 หลายเดือนก่อน

    could you plz explain more on the key and reverse part of sorted ...not available in sort i guess

    • @Pybites
      @Pybites  2 หลายเดือนก่อน

      Fortunately they are :)
      Does this make sense?
      >>> ll = ["9", 2, "5", 1]
      >>> ll.sort()
      Traceback (most recent call last):
      File "", line 1, in
      TypeError: '