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_fondamentales [2021/08/05 04:12] – [Gestion de l'encodage des caractères en Python] villersd | teaching:progappchim:notions_fondamentales [2022/01/12 09:36] – [Sélection ou instruction conditionnelle] villersd |
---|
| |
Les instruction if peuvent souvent être remplacées par une alternative plus lisible, plus générale. Cf. par exemple [[https://medium.com/swlh/3-alternatives-to-if-statements-to-make-your-python-code-more-readable-91a9991fb353|3 Alternatives to If Statements That Make your Code More Readable]] (Jonny Jackson, Medium, 24/09/2020) | Les instruction if peuvent souvent être remplacées par une alternative plus lisible, plus générale. Cf. par exemple [[https://medium.com/swlh/3-alternatives-to-if-statements-to-make-your-python-code-more-readable-91a9991fb353|3 Alternatives to If Statements That Make your Code More Readable]] (Jonny Jackson, Medium, 24/09/2020) |
| |
| Dans quelques cas, il est intéressant d'écrire les instructions conditionnelles sur une seule ligne de code. //Cf.// [[https://towardsdatascience.com/python-if-else-statement-in-one-line-ternary-operator-explained-eca2be64b7cc|Python If-Else Statement in One Line — Ternary Operator Explained - Single-line conditionals in Python? Here’s when to and when NOT to use them]] Dario Radečić, Medium, 11/01/2022 |
| |
| |
| |
==== Structures répétitives ==== | ==== Structures répétitives ==== |
* [[https://levelup.gitconnected.com/introducing-high-performance-datatypes-in-python-with-the-collections-library-3d8c334827a5|Introducing high-performance datatypes in Python with the collections library]] George Seif, Medium, Oct 15, 2019 | * [[https://levelup.gitconnected.com/introducing-high-performance-datatypes-in-python-with-the-collections-library-3d8c334827a5|Introducing high-performance datatypes in Python with the collections library]] George Seif, Medium, Oct 15, 2019 |
* [[https://medium.com/better-programming/your-one-stop-guide-to-collections-in-python-4c0b36243561|Your One-Stop Guide to Collections in Python - Make your code awesome using high-order containers]] Felix Antony, Medium, 21/01/2021 | * [[https://medium.com/better-programming/your-one-stop-guide-to-collections-in-python-4c0b36243561|Your One-Stop Guide to Collections in Python - Make your code awesome using high-order containers]] Felix Antony, Medium, 21/01/2021 |
| * [[https://towardsdatascience.com/write-ultra-concise-code-with-python-collections-ab79f03bb54|Write Ultra-Concise Code with Python collections | by Thomas Hikaru Clark | Oct, 2021 | Towards Data Science]] Thomas Hikaru Clark, Medium, 11/10/2021 |
| |
| |
Des types non intégrés par défaut dans Python peuvent facilement être implémentés, en utilisant les types répandus. C'est pas exemple le cas des [[https://fr.wikipedia.org/wiki/Arbre_enracin%C3%A9|arbres]] (informatique, théorie des graphes) : | Des types non intégrés par défaut dans Python peuvent facilement être implémentés, en utilisant les types répandus. C'est pas exemple le cas des [[https://fr.wikipedia.org/wiki/Arbre_enracin%C3%A9|arbres]] (informatique, théorie des graphes) : |
→ [[print_format|Impressions avec la méthode .print()]] | → [[print_format|Impressions avec la méthode .print()]] |
| |
FIXME : cf. [[https://datawhatnow.com/things-you-are-probably-not-using-in-python-3-but-should/]] (f-strings vs format) | FIXME **intégrer f-string !**: cf. |
| * [[https://datawhatnow.com/things-you-are-probably-not-using-in-python-3-but-should/]] (f-strings vs format) |
| * [[https://python.plainenglish.io/become-a-master-of-string-formatting-in-python3-252334a8269a|Become a Master of String Formatting in Python3]] by Maxence LQ, Python in Plain English, 25/05/2021 |
| |
Références : | Références : |