I am at a high-beginner/low-intermediate level in Python, and one thing that drives me nuts is how poorly I am able to read the Python official documentation and grok how to use the described code.

What’s the secret? Are there any guides/videos/books that can help my understand how to approach reading it? Or, is it just one of those things that I need to just keep coming back to while coding, and eventually I will get the hang of it?

    • thisisnotgoingwell@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      I recommend getting very familiar with pythons help(), dir() and type() functions. The help function almost always includes examples for the methods you’re trying to use, tells you what arguments it expects, and what arguments are passed by default. The type function can help you understand the inheritance of OOP and what type of object you’re looking at, and dir on that object will tell you what attributes/methods are defined for your object type.

      Other than that, find some good books. I’m a big fan of Michael Driscoll’s Python 101 and 201 books.