declic2de_ex55p174.py

Created by gilles-dhaussy

Created on December 12, 2023

508 Bytes


# Le programme de l'enonce a ete
# modifie, corrigeant l'indentation
# de la derniere ligne de la
# definition de la fonction
# parallelogramme, afin que celle-ci
# retourne toujours un resultat

def milieu(x1, y1, x2, y2):
  return ((x2+x1)/2, (y2+y1)/2)

def parallelogramme(xA, yA, xB, yB, xC, yC, xD, yD):
  paral = False
  if milieu(xA, yA, xC, yC)==milieu(xB, yB, xD, yD):
    paral = True
  return paral # indentation corrigee

print(parallelogramme(0, 2, 2, 1, 1, -1, -2,0))

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.