tp6_2de_enonce.py

Created by jean-luc-poncin

Created on November 16, 2021

461 Bytes

  • utilisation de fonctions et de variables
  • fonction f au sens mathématiques
  • aire d’un disque en fonction du rayon
  • montant TTC d’une facture en fonction d’effectifs d’articles (2 variables)
  • calcul d’hypoténuse en fonction des côtés de l’angle droit dans un triangle rectangle
  • tortue et tracés paramétrés par des variables


from math import *
from turtle import *

# Ex 6.1

def f(x):
    return(x**2+10*x+3)

# Ex 6.2
    

    
# Ex 6.3

def totalttc(npantalon,nchemise):
    totalht=npantalon*43.50+nchemise*37.25
    taxe=totalht*0.2
    return(totalht+taxe)

# Ex 6.4
    


# Ex 6.5
    
def pointilles(longueur,ecart,nombre):
    for i in range(nombre):
        forward(longueur)
        penup()
        forward(ecart)
        pendown()
        
# Ex 6.6

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.