Commit 96a40dab by BellCodeEditor

save project

parent 9cbcb9f1
Showing with 38 additions and 5 deletions
a=float(input())
b=float(a*2+2)
z=float(a+b)*2
m=float(a*b)
print(z)
print(m)
print(m//1)
\ No newline at end of file
import turtle
pen=turtle.Pen()
pen.down()
for i in range(3):
pen.left(120)
pen.forward(100)
pen.up()
pen.forward(120)
pen.down()
pen.left(120)
pen.forward(150)
pen.left(28)
pen.forward(50)
for i in range(5):
pen.forward(150)
pen.left(70)
pen.forward(50)
pen.forward(-50)
turtle.done()
...@@ -7,6 +7,7 @@ class Hero: # 英雄类 ...@@ -7,6 +7,7 @@ class Hero: # 英雄类
self.max_hp = self.hp self.max_hp = self.hp
def combat(self, enemy): # 攻击功能 def combat(self, enemy): # 攻击功能
info1 = self.name+"对"+enemy.name+"发起进攻," info1 = self.name+"对"+enemy.name+"发起进攻,"
info2 = "造成"+str(self.attack)+"点伤害," info2 = "造成"+str(self.attack)+"点伤害,"
...@@ -25,15 +26,16 @@ class Hero: # 英雄类 ...@@ -25,15 +26,16 @@ class Hero: # 英雄类
class Player(Hero): class Player(Hero):
def __init__(self,name): def __init__(self,name):
# 玩家英雄 # 玩家英雄
super().__init__(name) super(Palyer,self).__init__(name)
self.hp=200 self.hp=200
self.attack=50 self.attack=50
print("玩家的血量值为:",Player.hp)
print("玩家的攻击力为:",Player.attack)
houyi=Player("后羿")
player = Player("后羿") #print("玩家的血量值为:",player.hp)
print("玩家的血量值为:",player.hp) #print("玩家的攻击力为:",player.attack)
print("玩家的攻击力为:",player.attack)
print("hello world!")
\ 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