Commit 26913397 by BellCodeEditor

save project

parent e0cc6a34
Showing with 44 additions and 3 deletions
with open(r"C:\Users\悟空20\Desktop\锦瑟.txt",'w',encoding='utf-8')as file:
file.write("锦瑟无端五十弦"'\n'"一弦一柱思华年。")
\ 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
yase = Hero('垭瑟',300,20)
houyi = Hero('后羿',240,25)
def upgrade():
yase.level += 1
yase.hp += 50
yase.attack += 5
upgrade()
print('垭瑟的攻击力为:',yase.attack)
\ No newline at end of file
import turtle
x = turtle
x.penup()
x.goto(-100,100)
x.pendown()
for i in range(4):
x.forward(200)
x.right(90)
x.penup()
x.goto(-40,0)
x.pendown()
x.fillcolor("red")
x.begin_fill()
x.circle(10)
x.penup()
x.goto(0,0)
x.pendown()
x.circle(10)
x.penup()
x.goto(40,0)
x.pendown()
x.circle(10)
x.end_fill()
x.done()
\ 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