Kunci dinamis Kamus Python
# Dynamically naming Dictionary key, value item
dictionaryName['static_string_' + stringVariable] = otherVariable
# Example
dictOne = {}
strAnimal = 'dogOne'
intAge = 7
dictOne['age_of_' + strAnimal] = intAge
# Result
{'age_of_dogOne': 7}
Trained Tuna