Pour déterminer le nombre de clés dans un dictionnaire sous python il existe la fonction "built-in" len(), exemple:
>>> d = {'a':1,'b':2,'c':3,'d':4,'e':5}>>> len(d)5
ou
>>> len(d.keys())5
Références
| Liens | Site |
|---|---|
| Built-in Functions | python doc |
| Counting the Number of keywords in a dictionary in python | stackoverflow |
| Get the number of all keys in a dictionary of dictionaries in Python | stackoverflow |
| Python dictionary len() Method | tutorialspoint |
| Dictionary - to find the count of values for particular key | teamtreehouse |
