une suite d instructions executees dans un ordre clair.
atelier
Python
parcours pratique pour apprendre Python depuis zero
definition d abord
ce que signifie Python
Python sert a ecrire des instructions precises. Ici tu l abordes comme parcours pratique pour apprendre Python depuis zero. Commence par une idee simple: des entrees passent par des etapes et deviennent une sortie.
app.pyexecuter python app.pyhabitude apprends une petite piece de Python, tape un exemple minimal et execute-leune valeur est une donnee. Une variable est le nom qui la garde.
un petit travail nomme qui recoit une entree et produit un resultat.
Python 3 execute le code de app.py.
premier code lisible
Variables
names lists dictionaries stringsscore = 40 + 2 print(score)
sortie 42lignee du langage
arbre de Python
vois d ou vient Python, quels langages sont proches, et quoi apprendre ensuite.
parcours debutant
Banque de questions
Chercher puis pratiquer
Choisis une etape ou cherche dans la banque de ce langage puis ouvre l exercice.
Python question 1
Python question 1. Choisis l explication qui correspond le mieux a function definition.
Python question 2
Python question 2. Choisis l explication qui correspond le mieux a list append.
Python question 3
Python question 3. Choisis l explication qui correspond le mieux a dictionary access.
Python question 4
Python question 4. Choisis l explication qui correspond le mieux a for loop.
Python question 5
Python question 5. Choisis l explication qui correspond le mieux a function definition.
Python question 6
Python question 6. Choisis l explication qui correspond le mieux a list append.
Python question 7
Python question 7. Choisis l explication qui correspond le mieux a dictionary access.
Python question 8
Python question 8. Choisis l explication qui correspond le mieux a for loop.
Python question 9
Python question 9. Choisis l explication qui correspond le mieux a function definition.
Python question 10
Python question 10. Choisis l explication qui correspond le mieux a list append.
Python question 11
Python question 11. Choisis l explication qui correspond le mieux a dictionary access.
Python question 12
Python question 12. Choisis l explication qui correspond le mieux a for loop.
Python question 13
Python question 13. Choisis l explication qui correspond le mieux a function definition.
Python question 14
Python question 14. Choisis l explication qui correspond le mieux a list append.
Python question 15
Python question 15. Choisis l explication qui correspond le mieux a dictionary access.
Python question 16
Python question 16. Choisis l explication qui correspond le mieux a for loop.
Python question 17
Python question 17. Choisis l explication qui correspond le mieux a function definition.
Python question 18
Python question 18. Choisis l explication qui correspond le mieux a list append.
choix multiple
Python question 1
Python question 1. Choisis l explication qui correspond le mieux a function definition.
def add(a, b):
return a + breference
modeles pour app.py
python app.pynames lists dictionaries strings
Variables
score = 40 + 2 print(score)
- Indentation matters
- Use descriptive names
- Print intermediate values
def parameters return
fonctions
def add(a, b):
return a + b
print(add(2, 3))- Use def to name work
- Indent the body
- Return the result
for ranges lists dictionaries
Loops
for item in ["a", "b"]:
print(item)- Loop over values directly
- Use enumerate when index matters
- Keep loop bodies short