Write a function named concentric that uses turtle graphics
Write a function named concentric that uses turtle graphics to draw a concentric (same center) circle of specified radius. The function concentric takes two parameters: 1. t, a turtle that is used to draw the circle. The turtle t may be in any position, orientation and up/down state. 2. radius, a positive integer that is the radius of the circle to draw The function concentric should: 1. draw a circle whose center is the initial position of t 2. leave t in its initial position and orientation when it returns
Python use circle method
thank you
Solution
import turtle
def concentric(t, radius):
pos = t.position()
t.right(90) # Face South
t.forward(radius) # Move one radius
t.right(270) # Back to start heading
t.pendown()
t.circle(radius)
t.penup()
t.setposition(pos)
t=turtle.Turtle()
t.forward(100)
t.penup()
concentric(t, 30)
concentric(t, 20)
t.right(90)
t.forward(100)
