# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3.9.6 64-bit
#     name: python3
# ---

# +
class Robot:
    """Classe simulant un robot"""
    def __init__(self,x=0,y=0,direction=None) -> None:
        """Definition des coordonées + de la direction"""
        self.x=x
        self.y=y
        self.direction=direction
    def avancer(self,direction:str):
        """Methode petmettant d'avancer dans une direction donnée"""
        if direction.lower()=='nord' :
            self.y+=1
        if direction.lower()=='sud' :
            self.y-=1
        if direction.lower()=='est' :
            self.x+=1
        if direction.lower()=='ouest': 
            self.x-=1
        

        

    
# -

robot1=Robot(3,3)
robot1.avancer('Ouest')

StarcoderdataJupyterScriptsDedupFiltered