|
|
@@ -1,32 +1,11 @@ |
|
|
|
# None |
|
|
|
|
|
|
|
# Tuples |
|
|
|
|
|
|
|
* Attention, c'est la virgule qui fait le tuple, pas les parenthèses! |
|
|
|
* Unpacking |
|
|
|
* Note: can unpack lists too |
|
|
|
* Returning multiple values |
|
|
|
* Can't modify a tuple |
|
|
|
|
|
|
|
|
|
|
|
# Retour sur les listes |
|
|
|
|
|
|
|
* extend, pop, clear, index, count |
|
|
|
* sort |
|
|
|
* sort with a key function |
|
|
|
* lambdas |
|
|
|
* slices |
|
|
|
|
|
|
|
# Retours sur les strings |
|
|
|
|
|
|
|
* on peut aussi slicer des strings |
|
|
|
* index et count marchent aussi |
|
|
|
* But you can't modify a string |
|
|
|
* .format() |
|
|
|
|
|
|
|
What to return if the key is not in the dictionary ? |
|
|
|
get() -> None |
|
|
|
|
|
|
|
# None |
|
|
|
None est falsy |
|
|
|
|
|
|
|
* ... |
|
|
|
btw, it's also the default value for functions. No return => returns None |
|
|
|
|
|
|
|
# Mutabilité |
|
|
|
|
|
|
@@ -34,6 +13,7 @@ |
|
|
|
* sorted vs sort |
|
|
|
* Copie |
|
|
|
* Passage par référence dans les fonctions |
|
|
|
* None as default value |
|
|
|
|
|
|
|
|
|
|
|
# Fonctions avancées |
|
|
|