class Enemy:
def __init__(self, x):
self.energy = x
def get_energy(self):
print(self.energy)
jason = Enemy(5)
sandy = Enemy(9)
jason.get_energy()
sandy.get_energy()
class Enemy:
def __init__(self, x):
self.energy = x
def get_energy(self):
print(self.energy)
jason = Enemy(5)
sandy = Enemy(9)
jason.get_energy()
sandy.get_energy()
本文标题: Python 30 Programming Tutorial
本文链接:https://www.haomeiwen.com/subject/eiaxettx.html
网友评论