python:openclassrooms
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| python:openclassrooms [2020/05/05 20:27] – carl | python:openclassrooms [2020/07/10 12:39] (current) – carl | ||
|---|---|---|---|
| Line 16: | Line 16: | ||
| < | < | ||
| - | Pour afficher: | + | Pour afficher : |
| < | < | ||
| + | |||
| + | Pour demander à l' | ||
| + | < | ||
| + | |||
| + | Conditions : if, elif, else. | ||
| + | |||
| + | La fonction modulo = % : | ||
| + | < | ||
| + | a = int(y) | ||
| + | if a % 400 == 0: | ||
| + | print(a, " est bissextile" | ||
| + | elif a % 4 != 0 or a % 100 == 0: | ||
| + | print(a, " n'est pas bissextile" | ||
| + | else: | ||
| + | print (a, " est bissextile" | ||
| + | |||
| + | Les boucles : while et for : | ||
| + | < | ||
| + | while i < 10: | ||
| + | print i+1 | ||
| + | i += 1 # i = i + 1 | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | for letter in mot: | ||
| + | print letter | ||
| + | </ | ||
| + | |||
python/openclassrooms.1588710471.txt.gz · Last modified: by carl
