I have been looking into dictionary manipulation in python and I have reached an impasse on how to actually access sub elements of a generated dictionary.
(as you can maybe tell im pretty new to python coding)
d = {'Element': [1,2]}
print d['Element']
this returns:
[1,2]
But instead I would like to return only each element on separate lines.
Anyway if anyone has a better idea on how to store and access sub-elements it would be well appreciated to be shown the correct (or most correct) solution.
As Fredrik Pihl noted:
d = {'element':[0,1]}
print d['element'][1]
Returns: 1
Thanks guys for your assistance.
You can print line one by one with loop:
d = {'Element': [1,2]}
for line in d['Element']:
print line
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With