Reputation: 359
I have a tuple of dictionary of dictionary of list, I want to print value like
1
2
3
the given tuple is, how can I print that value.
k=('m',{'n':{'o':[1,2,3]}})
Upvotes: 0
Views: 93
Reputation: 239473
You can access the innermost list, like this k[1]["n"]["o"]
and then we convert each element of it to a string, which we later join with \n
and print it.
print "\n".join(map(str, k[1]["n"]["o"]))
Output
1
2
3
Upvotes: 3