This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |
| python:scratch2python:equivalences_entre_scratch_et_python [2021/12/29 18:32] – [Les fonctions] fab | python:scratch2python:equivalences_entre_scratch_et_python [2021/12/29 18:32] (current) – [Les conditions] fab |
|---|
| |<100% 400px 400px ->| | |<100% 400px 400px ->| |
| ^ Python ^ Scratch ^ Commentaire ^ | ^ Python ^ Scratch ^ Commentaire ^ |
| |<code>if mon_age < 18: | |<code python>if mon_age < 18: |
| print("Je suis mineur")</code>|{{:python:scratch2python:pasted:20211227-154556.png}}|L' instruction ''print'' est exécutée seulement si la condition qui suit l'instruction ''if'' est vraie| | print("Je suis mineur")</code>|{{:python:scratch2python:pasted:20211227-154556.png}}|L' instruction ''print'' est exécutée seulement si la condition qui suit l'instruction ''if'' est vraie| |
| |<code>if mon_age < 18: | |<code python>if mon_age < 18: |
| print("Je suis mineur") | print("Je suis mineur") |
| else: | else: |
| print("Je suis majeur")</code>|{{:python:scratch2python:pasted:20211227-160135.png}}|Si la condition qui suit l'instruction ''if'' est vraie, alors la première instruction ''print'' est exécutée, sinon, la seconde est exécutée.| | print("Je suis majeur")</code>|{{:python:scratch2python:pasted:20211227-160135.png}}|Si la condition qui suit l'instruction ''if'' est vraie, alors la première instruction ''print'' est exécutée, sinon, la seconde est exécutée.| |
| |<code>if ma_vitesse > 0: | |<code python>if ma_vitesse > 0: |
| print("J'avance") | print("J'avance") |
| elif ma_vitesse < 0: | elif ma_vitesse < 0: |