import randomapp
class feiji:
changdu = '20米'
wuqi = ''
licheng = '1000公里'
zaizhong = "20噸"
xueliang = 1
def feixing(self):
print('開始飛行')
def jiayou(self):
print('開始加油')dom
class zhandouji(feiji):
num = 1
changdu = '5米'
licheng = '500公里'
zaizhong = "10噸"
xueliang = 3
def init(self,num,wuqi = '導彈'):
self.wuqi = wuqi
self.num = num
def kaihuo(self):
print(self.num,'號戰鬥機開始發射',self.wuqi )
def zhongdan(self):
self.xueliang = self.xueliang - 1ide
class yunshuji(feiji):
def init(self,huowu = '兵'):
self.huowu = huowu
changdu = '30米'
licheng = '2000公里'
zaizhong = "100噸"
xueliang = 10
def zhuanghuo(self):
print('開始裝' + self.huowu)
def xiehuo(self):
print('開始空投'+self.huowu)
class wurenji(feiji):
def init(self, deren='敵人'):
self.deren = deren
changdu = '3米'
licheng = '2000公里'
zaizhong = "0千克"
xueliang = 1
def xiehuo(self):
print('開始掃描'+self.deren)it
zhandoujiArr = []
for item in range(0,100):
zhandoujiArr.append(zhandouji(item))class
for item in range(0,random.randint(1,5)):
zhandoujiArr[10].zhongdan()
if(zhandoujiArr[10].xueliang <= 0):
print(zhandoujiArr[10].num,'號戰鬥機已被摧毀')
else:
print(zhandoujiArr[10].num,'號戰鬥機血量還剩',zhandoujiArr[10].xueliang)import