Commit 952d5800 by BellCodeEditor

auto save

parent f47689a4
Showing with 28 additions and 0 deletions
import turtle#调用turtle库
pen=turtle.Pen() #使用turtle中的pen画笔
pen.speed(20)#h画笔移动速度
colors=['red','yellow','blue','green']
for i in range(1,300): # i = 0 1 2 3 -----299 #for 循环
pen.color(colors[i%4]) # % 求余
pen.forward(i)
pen.right(91)
# distance=distance+1 #distance += 1
turtle.done() #保留画布
\ No newline at end of file
for i in range (1,10):#j =1
for j in range(1,i+1): #
print(j,'×',i,'=',(j*i),end=' ')
print()
\ No newline at end of file
class Hero:#类名
def __init__(self,name,hp,attack):#name hp attack 形参
self.level=1 #类属性 等级
self.name=name
self.hp=hp #血量
self.attack=attack #攻击力
hero01=Hero('亚瑟',200,30)#xiangyu 对象
hero01.hp=350
print('英雄的名字为:'+hero01.name)
print('英雄的血量为:'+str(hero01.hp))
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