views:

56

answers:

1

how do you write a command that turn left or right at an angle in a superclass is it like this:

def left(self):
  self.position += self.angle
  return (self.position)

is it the same as the forward and back command

+1  A: 

It looks like you are interested by something like the logo turtle. Look at http://docs.python.org/library/turtle.html

If so, the left function doesn't change the position of the turtle but its orientation.

def left(self, angle):
    self.angle -= angle*2*math.pi/360
luc
its part of Object oriented Python
hugh