Weekly backup.

This commit is contained in:
2022-06-04 12:57:39 +02:00
parent e552583393
commit 015b896f65
68 changed files with 3530 additions and 27 deletions

View File

@@ -0,0 +1,26 @@
:PROPERTIES:
:ID: 16d16a4b-6a4c-4597-a45f-1a99f2cb9f29
:mtime: 20220516154116
:ctime: 20220516151958
:END:
#+title: Any et all d'un iterable vide
* Introduction
#+BEGIN_SRC python :results output
print(f"{any([])=}")
print(f"{all([])=}")
#+END_SRC
#+RESULTS:
: any([])=False
: all([])=True
* Explications
* La fonction /build-in/ /any/ recherche le premier élément ~True~, et si aucun n'esst trouvé, retourne ~False~ (cas
lorsque une /list/ est vide), sinon ~True~.
* La fonction /build-in/ /all/ recherche le premier élément ~False~, et si aucun n'est trouvé, retourne ~True~, ~False~ sinon.
* Références
* [[https://medium.com/@saint_sdmn/10-hardest-python-questions-98986c8cd309][10 Hardest Python Questions - Medium]]