输入半径,由四个半圆组成,按逆时针顺序画 用turtle.right(90)也可以
import turtle
n = eval(input())
turtle.circle(n,180)
turtle.seth(90)
turtle.circle(n,180)
turtle.seth(180)
turtle.circle(n,180)
turtle.seth(-90)
turtle.circle(n,180)
turtle.seth(0)
由2n个半径为r的半圆构成的类似正弦曲线,键盘输入不同的n和r值 方法一:
import turtle
n,r = map(int,input().split())
for i in range(n):
turtle.seth(-90)
turtle.circle(r,-180)
turtle.seth(-90)
turtle.circle(r,180)
方法二:
import turtle
n,r = map(int,input().split())
turtle.seth(90)
for i in range(n):
turtle.circle(-r,180)
turtle.circle(r,180)
由5个弧组成,按数字标注顺序画
|