self 参数

  1. class Person:
  2. def __init__(mysillyobject, name, age):
  3. mysillyobject.name = name
  4. mysillyobject.age = age
  5.  
  6. def myfunc(abc):
  7. print("Hello my name is " + abc.name)
  8.  
  9. p1 = Person("Bill", 63)
  10. p1.myfunc()