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
有帮助吗?

解决方案

  • 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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top