Dictionary Count
Dictionary Count
Section titled “Dictionary Count”Type: dict-count · Package: Collections Activities v1.0.3 · Output: int
Gets how many key-value pairs a dictionary has.
How it works
Section titled “How it works”Counts the entries of dict and returns the number. It does not modify the dictionary.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
dict | Dictionary | — | The dictionary. |
Optional parameters
Section titled “Optional parameters”None.
Output
Section titled “Output”Returns an int with the number of entries; 0 if the dictionary is empty.
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
'dict' must be a Dictionary, got …. | dict is not a dictionary (the message shows the type received, or null if the variable is empty). |
Example
Section titled “Example”Dictionary Count dict = totals → output: nLog message = "There are " + n + " categories"Related activities
Section titled “Related activities”- Get Dictionary Keys — list the keys.
- Get Dictionary Value — read a value.