def polyline(t,n,length,angle):
"""Draws n line segments with the given length and
angle(in degrees) between them. t is a turtle.
"""
for i in range(n):
t.fd(length)
t.lt(angle)
def polyline(t,n,length,angle):
"""Draws n line segments with the given length and
angle(in degrees) between them. t is a turtle.
"""
for i in range(n):
t.fd(length)
t.lt(angle)
alex=turtle.Turtle()
#Test polyline
polyline(alex,5,780,90)
失败了:
alex=turtle.Turtle()
#insert some other functions
#define polyline function
#call polyline