I have a class Test
with class parameter
parameters = {'first': [1,2,3,4], 'second': [5,6,7]}
. I want to convert it into a dictionary so that it will be "{'Test': 'first':1 'second':5}"
what I tried is:
di = {}
di = dict(itertools.izip(name, vals))
where I'm getting Test i.e classnane in variable name i.e name = Test
and
vals = {'first': [1,2,3,4], 'second': [5,6,7]}
Though I want it as "{'Test': 'first':1 'second':5}"
, shouldn't this print "{'Test': 'first':[1,2,3,4] 'second':[5,6,7]}"
?? Instead what I'm getting when I'm printing di
is {'Test': 'first'}
. I'm not getting where my logic is going wrong.