I have a function where I will check whether key of a dictionary is properly formatted. The problem is that this dictionary can have variable lengths. For example: