oop combination

What it is is a combination of two classes defined when a cell phone is a man 

People can use the phone inside the skill phone texting skills can be called micro-Bo

And when people in the parameter passing it as a parameter of pure cell phone into the phone so that you can use the skills of the

 

 

Shouji class: 
DEF __init __ (Self, pipai, jiaqian, Xinghao):
self.pipai = pipai
self.jiaqian = jiaqian
self.xinghao = Xinghao
DEF CHO (Self):
Print ( "call")
DEF dx (Self):
Print ( "send text messages")
class Ren:
DEF the __init __ (Self, name, Age, Shouji):
the self.name name =
self.age = Age
self.shouji = Shouji
DEF Jineng (Self):
Print (F '{Self. }} {self.age name ")


Shouji Shouji = (" apple ", 10000,520)
REN = Ren (" Xin Yang ", 20 is, Shouji)
ren.shouji.dx ()
ren.shouji.cho ()
REN. jineng ()

Guess you like

Origin www.cnblogs.com/yangxinpython/p/11247654.html