From 837be403a8c60ad914b1fe75d014ec6c6a00c6da Mon Sep 17 00:00:00 2001 From: "jean-lou.saulnier" Date: Mon, 16 May 2022 09:50:35 +0200 Subject: [PATCH] salut --- algo.py | 5 +++++ lecture_csv.py | 12 ++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 algo.py diff --git a/algo.py b/algo.py new file mode 100644 index 0000000..ecbf091 --- /dev/null +++ b/algo.py @@ -0,0 +1,5 @@ +def distance(tup_1, tup_2): + mn = (tup_1[0]-tup_2[0])**2+(tup_1[1]-tup_2[1])**2+(tup_1[2]-tup_2[2])**2 + return mn + +print(distance((338, 4.2, 6.3),(128, 14.8, 14.8))) \ No newline at end of file diff --git a/lecture_csv.py b/lecture_csv.py index 4b9ed43..038db52 100644 --- a/lecture_csv.py +++ b/lecture_csv.py @@ -1,5 +1,8 @@ import datetime +def kPlusProches(lst[0][1], lst): + + def numeroJour(date): """renvoie un entier correspondant au numéro du jour correspondant (entre 1 et 365)""" try: @@ -22,8 +25,9 @@ def lecture(name): return lst_return -print(lecture("jeuTests.csv")) +def distance(tup_1, tup_2): + mn = (tup_1[0]-tup_2[0])**2+(tup_1[1]-tup_2[1])**2+(tup_1[2]-tup_2[2])**2 + return mn - - - \ No newline at end of file +lst = lecture("jeuTests.csv") +dist = distance(lst[0][1],lst[1][1])