您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
此仓库已存档。您可以查看文件和克隆,但不能推送或创建工单/合并请求。
 
 
 
 
 
 

58 行
644 B

  1. Booléens et conditions
  2. ======================
  3. True et False
  4. --------------
  5. En Python ce sont des mots-clés et les valeurs sont en majuscules!
  6. Assignation
  7. -----------
  8. On peut assigner des variables aux valeurs True et False
  9. .. code-block:: python
  10. la_terre_est_plate = False
  11. python_c_est_genial = True
  12. ## Comparaisons
  13. .. code-block:: python
  14. >>> a = 2
  15. >>> b = 3
  16. >>> a > b
  17. False
  18. .. code-block:: python
  19. >>> 2 + 2 == 4
  20. True
  21. Note: ``==`` pour la comparaison, ``=`` pour l'assignation
  22. ```
  23. >>> a = 2
  24. >>> b = 3
  25. >>> a != b
  26. True
  27. >>> 2 + 2 >= 4
  28. True
  29. ```
  30. ```
  31. >>> a = 2
  32. >>> a < 2
  33. False
  34. >>> 1 < a < 3
  35. True
  36. ```