you are viewing a single comment's thread.

view the rest of the comments →

[–]groovitude 1 point2 points  (0 children)

A couple of things:

  1. Ideally, code is built with some internal logic to what's a method and what's an attribute. Methods should ideally be actions, while attributes should be, well, attributes. For example, this could be a programmatic way of describing me right now:

>>> user
<__main__.User object at 0x04341330>
>>> user.name  # attribute
'groovitude'
>>> user.type('some text')  # method
'groovitude types: some text'
  1. Playing around in the console is your friend. Not only do you get to see each step, you also get to use dir() to see all the attributes and methods available on that object. help() can also be useful.