Commit 7674d4eb by BellCodeEditor

auto save

parent 7cd3392e
Showing with 43 additions and 12 deletions
import turtle
pen=turtle.Pen()
pen.pensize(5)
pen.pencolor("blue")
pen.left(90)
pen.circle(50)
pen.pencolor("black")
pen.circle(-50)
pen.penup()
pen.right(90)
pen.forward(100)
pen.left(90)
pen.pendown()
pen.pencolor("red")
pen.circle(-50)
pen.right(180)
pen.penup()
pen.forward(50)
pen.right(90)
pen.forward(50)
pen.right(90)
pen.pendown()
pen.pencolor("green")
pen.circle(-50)
pen.pencolor("yellow")
pen.circle(50)
pen.hideturtle()
turtle.done()
import turtle s=0
pen=turtle.Pen() a=input("请输入一段带有一个或多个'python'的话")
pen.pensize(5) for i in range(len(a)):
pen.pencolor("red") if a[i:i+6]=='python':
pen.left(45) s+=1
pen.forward(100) print("python出现的次数为",s)
pen.circle(50,180)
pen.right(90)
pen.circle(50,180)
pen.forward(100)
pen.hideturtle()
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