How to add sub-attributes in a dictionary file?