a=[{"a":30},{"c":("a","=","c")}]
I need values of "c"
.
for x in a[1].values():
for j in x:
print(j, end=" ")
This is my solution but if you have any other short solution for this then tell me.
a=[{"a":30},{"c":("a","=","c")}]
I need values of "c"
.
for x in a[1].values():
for j in x:
print(j, end=" ")
This is my solution but if you have any other short solution for this then tell me.
If you just need the values to be printed, you can unpack the tuple as arguments to print
:
print(*a[1]['c'])
The same result can be achieved with a comprehension:
>>> a=[{"a":30},{"c":("a","=","c")}]
>>> print(*(_ for _ in a[1]['c']))
a = c
>>>