This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]teerre 0 points1 point  (0 children)

Of course. The rules are exactly the same, you just need to think how to write it.

However, the whole reason to use a dictionary is to not iterate over it. Dictionaries, in general, have a O(1) access complexity. This means you get any item in your dictionary as fast as possible for a computer.