python - angles commands in superclass -
How do you write a command that turns left or right in a superclass at an angle this way:
def left (self): self.position + = self.angle return (self.position)
This is similar to the back and forth command
It seems that you have some interest in the logo like turtle.
If this is the case, then the left function can not change the state of turtle, but its orientation.
def left (self, angle): self.angle - = angle * 2 * math.pi / 360
Comments
Post a Comment