Commit 7f3916a6 by BellCodeEditor

auto save

parent 1b516b42
# 英雄角色类
class Hero(object):
def __init__(self, name):
self.level = 1
self.hp = 250
self.attack = 40
self.name = name
def combat(self,enemy):
enemy.hy=enemy.hp-self.attack # 攻击
info1=self.name+'对'+enemy.name+'发动攻击' # 攻击
info2='造成'+str(self.attack)+'点伤害'
if enemy.hp>0:
info3=enemy.name+'还剩下'+str(enemy.hp)+'血量'
info=info1+info2+info3
print(info)
else:
info3=enemy.name+'游戏失败'
info=info1+info2+info3
print(info)
exit
yase = Hero("垭瑟")
houyi= Hero("后羿")
yase.combat(houyi)
text="周末一起去欢乐谷吧"
li_text=list(text)
print(li_text)
print("华为")
\ No newline at end of file
x0=int(input())
x1=int(input())
y0=int(input())
y1=int(input())
if x0<y0:
a=y0-x0
if x0>y0:
a=x0-y0
if x1<y1:
s=y1-x1
if x1>y1:
s=x1-y1
print(a)
print(s)
\ No newline at end of file
s=input()
a=20-len(s)
d=a//2
if d%2!=0:
q=1
c=a-1
else:
q==0
if q==1:
print(c*" "+s+c*" "+" ")
if q==0:
print(c*" "+s+c*" ")
\ No newline at end of file
++ "b/edafd\343\200\202py"
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