This is the problem

Implement a function called get_direction which, on a particular character
, gives the
direction corresponding to that character. The correspondences are as
follows:
 The character ’w’ corresponds to the direction ’North’
 The character ’a’ corresponds to the direction ’West’
 The character ’s’ corresponds to the direction ’South’
 The character ’d’ corresponds to the direction ’East’


I am having difficulty coming up with a function and testing it as well.

I have tried

def get_direction(self):
        """
        whenever a key is pressed the character moves to
        the direction corresponding to the key
        """
        'North':w
        'South': s
        'East' : d
        'West' : a

but it didn't work...please help.
-- 
*Akuma*
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to