Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente Prochaine révisionLes deux révisions suivantes |
teaching:progappchim:notions_avancees [2022/12/06 10:39] – [Liste en compréhension] villersd | teaching:progappchim:notions_avancees [2023/03/22 09:29] – villersd |
---|
==== Itertools, zip,... ==== | ==== Itertools, zip,... ==== |
* [[https://medium.com/techtofreedom/7-levels-of-using-the-zip-function-in-python-a4bd22ee8bcd|7 Levels of Using the Zip Function in Python]] | * [[https://medium.com/techtofreedom/7-levels-of-using-the-zip-function-in-python-a4bd22ee8bcd|7 Levels of Using the Zip Function in Python]] |
| * itertools.cycle() est une méthode utile pour répéter ou parcourir sans fin les éléments d'une liste ou d'une table itérativitertools.accumulate() |
| * itertools.accumulate prend un itérable et une fonction d'accumulation, puis renvoie un itérateur. |
| |
===== Générateurs et "yield" ===== | ===== Générateurs et "yield" ===== |
* [[http://fr.openclassrooms.com/informatique/cours/pratiques-avancees-et-meconnues-en-python/les-generateurs-2]] | * [[http://fr.openclassrooms.com/informatique/cours/pratiques-avancees-et-meconnues-en-python/les-generateurs-2]] |
* [[https://iam-akshay.medium.com/python-one-liner-superb-tricks-c611aad98553|Python one-liner superb tricks]] Akshay Jain, Medium, 16/04/2022 | * [[https://iam-akshay.medium.com/python-one-liner-superb-tricks-c611aad98553|Python one-liner superb tricks]] Akshay Jain, Medium, 16/04/2022 |
* [[https://theanup.medium.com/10-powerful-python-one-liners-for-daily-use-8733dac0bc2c|15 Powerful Python One-Liners for Daily Use]] Anup Das, Medium, 22/11/2022 | * [[https://theanup.medium.com/10-powerful-python-one-liners-for-daily-use-8733dac0bc2c|15 Powerful Python One-Liners for Daily Use]] Anup Das, Medium, 22/11/2022 |
| |
| ==== One-line if - then - else (ternary operator) ==== |
| <code python> |
| u = 10 |
| v = 100 |
| reponse = "u plus grand que v" if u > v else "v plus grand ou égal à u" |
| print(reponse) |
| </code> |
| |
| |
* [[https://towardsdatascience.com/write-clean-python-code-using-pipes-1239a0f3abf5|Write Clean Python Code Using Pipes - A Short and Clean Approach to Processing Iterables]] Khuyen Tran, medium, october 2021 | * [[https://towardsdatascience.com/write-clean-python-code-using-pipes-1239a0f3abf5|Write Clean Python Code Using Pipes - A Short and Clean Approach to Processing Iterables]] Khuyen Tran, medium, october 2021 |
* ... | * ... |
| |
| ===== Walrus operator ===== |
| FIXME |
| |
===== Le rôle du caractère underscore en Python ===== | ===== Le rôle du caractère underscore en Python ===== |