Commit e4471840 by BellCodeEditor

save project

parent 22354288
Showing with 54 additions and 0 deletions
class jj:
def __init__(self,name,foot,skin):
self.level=1
self.name=name
self.foot=foot
self.skin=skin
yuh=jj(2,4,"black")
print(yuh.name)
\ No newline at end of file
class kd:
def __init__(self,foot,eye):
self.foot=foot
self.eye=eye
def upgrade(self):
self.foot=self.foot+2
self.eye=self.eye+1
kd=kd(2,4)
kd.upgrade()
print('蝌蚪的脚'+str(kd.foot))
\ No newline at end of file
class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
def upgrade(self):
self.level=self.level+1
self.hp=self.hp+50
self.attack=self.attack+4
yase=Hero('yase',300,20)
yase.upgrade()
print('亚瑟的血量'+str(yase.hp))
i1={"数学":99,"语文":67,"英语":100}
i2={"数学":89,"语文":89,"英语":92}
i3={"数学":100,"语文":97,"英语":98}
h={"小明":i1,"小红":i2,"秀秀":i3}
while True:
print("*"*30)
name=input("你的名字/(不查了写不差了):")
if name=="不查了":
break
if name in h:
for v,p in h[name].items():
print(v,p)
else:
print("名字不在")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment