Frage

I'm new to Python. Just trying to get my head around some terminology. Take the following example:

mylist = [1, 2, 3]
mylist.pop(3)

Are the following statements correct:

  • mylist is an object of the class list
  • pop is a method of mylist
  • 3 is a variable of the list mylist
  • 3 is a variable of the method pop
War es hilfreich?

Lösung

  • mylist is an instance of the class (or type) list

  • pop is a method of mylist

  • 3 is a member of mylist or 3 is contained in mylist

  • 3 is the argument to the method pop

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top