e une chaîne.
<code python>
>>> user = "yoann:x:1000:1000:yoann,,,:/home/yoann:/bin/bash"
>>> list_attributs = user.split(':') ...
['yoann', 'x', '1000', '1000', 'yoann,,,', '/home/yoann', '/bin/bash']
</code>
===== Le slicing =====
Comme pour les lis
± 33.5 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)
# Parcourir une liste 100 fois plu... on 100 fois plus de temps
%timeit 'x' in range(10_000) ... s ± 7.4 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
# Parcourir une liste 100 fois plus ... ore 100 fois plus de temps
%timeit 'x' in range(1_000_000)
bool(0.0)
False
>>> bool(2+4)
True
>>> bool(-0.0000000000000000000000001)
True
>>> # Toute chaîne de caractères non vide est vraie
>>> bool('False')
True
>>>