Commit 45306e02 by BellCodeEditor

save project

parent 9fb91e53
Showing with 70 additions and 5 deletions
with open(r"C:\Users\mk-18\Desktop\book.txt",'w',encoding='utf-8') as file1:
file1.write('小丽:11本\n')
file1.write('李雯:9本\n')
file1.write('张伟:16本\n')
new_data = ''
with open(r"C:\Users\mk-18\Desktop\book.txt",'r',encoding='utf-8') as file1:
for data in file1:
if '李雯:9本' in data:
data = data.replace('李雯:9本','李雯:10本')
if '小丽:11本' in data:
data = data.replace('小丽:11本','小丽:14本')
new_data += data
with open(r"C:\Users\mk-18\Desktop\book.txt",'w',encoding='utf-8') as file1:
file1.write(new_data)
with open(r"C:\Users\mk-18\Desktop\book.txt",'r',encoding='utf-8') as file1:
a = file1.read()
print(a)
\ No newline at end of file
for i in range(1,10):
for j in range(1,i+1):
print(j,'*',i,'=',(j*i),end='')
print()
\ No newline at end of file
import turtle
pen = turtle.Pen()
pen.pencolor("pink")
pen.pensize(10)
pen.fillcolor("yellow")
pen.penup()
pen.goto(100,-100)
pen.pendown()
pen.left(90)
pen.forward(200)
pen.left(90)
pen.pendown()
pen.forward(200)
pen.left(90)
pen.pendown()
pen.forward(200)
pen.left(90)
pen.pendown()
pen.forward(200)
pen.penup()
pen.penup()
pen.pencolor("purple")
pen.goto(0,-50)
pen.pendown()
pen.fillcolor("blue")
pen.begin_fill()
pen.circle(50)
pen.end_fill()
turtle.done()
import turtle
p=turtle.Pen()
p.pensize(3)
p.pencolor("blue")
p.fillcolor("pink")
p.begin_fill()
p.goto(0,0)
p.goto(0,100)
p.goto(100,100)
p.goto(100,0)
p.goto(0,0)
p.end_fill()
turtle.done()
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