Add new python note about float round
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
:PROPERTIES:
|
||||
:ID: 4fabfe6a-b104-464f-8a87-dfd7d761dbcc
|
||||
:mtime: 20220130162518
|
||||
:mtime: 20220207072855
|
||||
:ctime: 20211230101535
|
||||
:END:
|
||||
#+title: Python
|
||||
@@ -35,3 +35,4 @@ Formatter n'appliquant que le style [[https://black.readthedocs.io/en/stable/the
|
||||
** [[id:4ef76164-0e67-410a-8d26-b03071a0cc41][Compter la fréquence des éléments d'une liste]]
|
||||
** [[id:cb3c63b9-6452-4016-9b2f-a25784941d5d][List vs deque]]
|
||||
** [[id:9bdede16-5137-4393-a027-a5afbffd1618][Génération chaine de caractères aléatoires]]
|
||||
** [[id:f7c05933-90e6-4a9c-acd5-1f0baf62f07f][Arrondir les flottants en python]]
|
||||
|
26
20220206220528-arrondir_les_flottants_en_python.org
Normal file
26
20220206220528-arrondir_les_flottants_en_python.org
Normal file
@@ -0,0 +1,26 @@
|
||||
:PROPERTIES:
|
||||
:ID: f7c05933-90e6-4a9c-acd5-1f0baf62f07f
|
||||
:mtime: 20220207072847
|
||||
:ctime: 20220206220528
|
||||
:END:
|
||||
#+title: Arrondir les flottants en python
|
||||
#+filetags: :Python:
|
||||
|
||||
* Arrondir un nombre à l'entier inférieur
|
||||
#+BEGIN_SRC python :results output
|
||||
print(22 // 5)
|
||||
#+END_SRC
|
||||
|
||||
#+RESULTS:
|
||||
: 4
|
||||
|
||||
* Arrondir un noombre à l'entier supérieur
|
||||
#+BEGIN_SRC python :results output
|
||||
print(22 // -5 * -1)
|
||||
#+END_SRC
|
||||
|
||||
#+RESULTS:
|
||||
: 5
|
||||
|
||||
* Références
|
||||
* [[https://www.delftstack.com/fr/howto/python/python-round-up/][Arrondir un nombre en Python]]
|
Reference in New Issue
Block a user