Welcome to the Strap template.
If you don't known the ComboStrap, it's recommended to follow the Getting Started Guide.
Otherwise, to create a menu bar in the header, create a page with the id (slot_header) and the menubar component.

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
python:fonctions [2019/10/20 15:49] physixpython:fonctions [2020/07/24 03:31] (Version actuelle) – modification externe 127.0.0.1
Ligne 1: Ligne 1:
 ====== Fonctions ====== ====== Fonctions ======
  
-<code>+===== Créer une fonction ===== 
 + 
 +<code python>
 def parabole(x): def parabole(x):
     return x ** 2 - 3     return x ** 2 - 3
Ligne 11: Ligne 13:
 Pour l'utiliser, il suffit de taper parabole et un argument entre parenthèses. Cet argument sera affecté à la variable x de la définition de la fonction. Cette fonction renverra alors le résultat. Pour l'utiliser, il suffit de taper parabole et un argument entre parenthèses. Cet argument sera affecté à la variable x de la définition de la fonction. Cette fonction renverra alors le résultat.
  
-<code>+<code python>
 parabole(4) parabole(4)
 +
 +</code>
 +
 +===== Importer une fonction =====
 +
 +<code python>
 +from math import cos, pi
 +
 +print(pi)
 +
 +print(cos( pi / 3. )
 +
 +</code>
 +
 +donne
 +
 +<code python>
 +3.141592653589793
 +
 +0.5000000000000001
 +
 +</code>
 +
 +----
 +
 +<code python>
 +import math
 +
 +print(math.cos( math.pi / 3. ))
 +
 +</code>
 +
 +donne
 +
 +<code>
 +0.5000000000000001
 +
 +</code>
 +
 +
 +
 +<code python>
 +import math as m
 +
 +print(m.cos ( m.pi / 3. ))
 +
 +</code>
 +
 +donne
 +
 +<code>
 +0.5000000000000001
  
 </code> </code>
  
  
Welcome to the Strap template. To get started, create a page with the id slot_footer to create a footer.
Powered by ComboStrap