I am using Python 3.6 with Django Framework.
I am getting input from the user & that input comes in the form of dictionary in my views.py. Lets say, the user enter 3 values than my dictionary will hold value like
my_dict = {'name1': abc, 'job1': xyz, 'pos1':tak, 'phone1': 12345, 'name2': pqr, 'job2': ftr, 'pos2': lkj, 'phone2': 27654, 'name3': swq, 'job3': nme, 'pos3': mnb, 'phone3': 98421}
I am looking to create sub dictionaries depending on the user input, in above case 3. Expected output is
dict1 = {'name1': abc, 'job1': xyz, 'pos1': tak, 'phone1': 12345}
dict2 = {'name2': pqr, 'job2': ftr, 'pos2': lkj, 'phone2': 27654}
dict3 = {'name3': swq, 'job3': nme, 'pos3': mnb, 'phone3': 98421}
Now, the catch here is we don't know what number of records we get from user, so sub dictionaries also need to be created dynamically. "dict1" to "dictn" where "n" is number given by user. Please suggest!