I am using the below python code to create a dictionary.But I am getting one PEP 8 warning for the dct_structure variable. Warning is: do not use a lambda expression use a def
from collections import defaultdict
dct_structure = lambda: defaultdict(dct_structure)
dct = dct_structure()
dct['protocol']['tcp'] = 'reliable'
dct['protocol']['udp'] = 'unreliable'
I am not comfortable with python lambda expression yet. So can anyone help me to define the function for the below two line of python code to avoid the PEP warning.
dct_structure = lambda: defaultdict(dct_structure)
dct = dct_structure()