Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
python:fonctions [2019/10/20 15:53] – physix | python:fonctions [2020/07/24 03:31] (Version actuelle) – modification externe 127.0.0.1 | ||
---|---|---|---|
Ligne 3: | Ligne 3: | ||
===== Créer une fonction ===== | ===== Créer une fonction ===== | ||
- | < | + | < |
def parabole(x): | def parabole(x): | ||
return x ** 2 - 3 | return x ** 2 - 3 | ||
Ligne 13: | Ligne 13: | ||
Pour l' | Pour l' | ||
- | < | + | < |
parabole(4) | parabole(4) | ||
Ligne 20: | Ligne 20: | ||
===== Importer une fonction ===== | ===== Importer une fonction ===== | ||
- | < | + | < |
from math import cos, pi | from math import cos, pi | ||
Ligne 31: | Ligne 31: | ||
donne | donne | ||
- | < | + | < |
3.141592653589793 | 3.141592653589793 | ||
Ligne 40: | Ligne 40: | ||
---- | ---- | ||
- | < | + | < |
import math | import math | ||
Ligne 54: | Ligne 54: | ||
</ | </ | ||
- | ---- | ||
- | < | + | |
+ | < | ||
import math as m | import math as m | ||