def points(x, y): """Détermine si un tir vaut 2 ou 3 points en fonction de sa position.""" if x <= 150 and (y - 300) ** 2 + x ** 2 <= 150 ** 2: return 2 if x >= 850 and (y - 300) ** 2 + (x - 1000) ** 2 <= 150 ** 2: return 2 return 3 # Test de la fonction if __name__ == "__main__": print(points(50, 300)) # Devrait retourner 2 (tir à l'intérieur du demi-cercle) print(points(500, 300)) # Devrait retourner 3 (tir en dehors des demi-cercles)