You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
707 B

# petit test pour être sûr d'avoir le bon fichier
# et transformer chaque ligne en liste
with open("stats.txt", "r") as f:
for lignes in f:
lst_clean = lignes.strip()
lst_ligne = lst_clean.split()
#print(lst_ligne)
# fonction pour déterminer nombre de points d'un tir
def points(x, y):
# regarde si le lancer et dans demi-cercle gauche
# sinon demi - cercle droite et sinon c'est que le tir est fait en dehors
if x <= 300 and 50<=y<=550:
return 2
elif x>= 700 and 50<=y<=550:
return 2
else:
return 3
print(points(200, 100)) # test1
print(points(800, 100)) # test2
print(points(500, 700)) # test3