实例三,在特殊方法中除self之外定义2个形参

  1. class SomeClass2(object):
  2. def __init__(self, data1, data2):
  3. self.data1 = data1
  4. self.data2 = data2
  5. sc2 = SomeClass2(18, 20)
  6. print(sc2) # <__main__.SomeClass2 object at 0x7f127bc0d8d0>