• Krusty@quokk.au
    link
    fedilink
    English
    arrow-up
    2
    ·
    14 天前

    Cat pictures sound amazing. But first I need to reverse a list in Python. Any suggestions?

    • mcmodknower@programming.dev
      link
      fedilink
      English
      arrow-up
      2
      ·
      13 天前

      Surely! Python lists have a native reverse() method (source), so you should use it. Here is an example of how to use the reverse() method:

      >>> mylist = [12, 34, 56]
      >>> mylist.reverse()
      >>> mylist
      [65, 43, 21]
      

      Do you want to know more about reversing a list in python? I could show you more examples or how to implement the reversion yourself.

      Since you also want cat pictures, here is one: A black cat with a Darth Vader helmet, and a text block wich says "Ich bin dein Kater!"