ich weiß, aufgrund des simplen Konstruktes übersehe ich scheinbar nur was vollkommen offensichtliches ... aber ich komme nicht drauf:
Wieso kriege ich hier einen ValueError und angeblich nur eines anstelle von 2 Werten?
Code: Alles auswählen
opts = [('1', '2'), ('3', '4')]
for pair in opts:
print(pair)
print(len(pair))
for o, a in pair:
if o == '1':
print(a)
Danke und sorry wegen der n00b - Frage ...('1', '2')
2
Traceback (most recent call last):
File "/vagrant_data/Misc_Tools/KVM_XML_Monitor/test.py", line 5, in <module>
for o, a in pair:
ValueError: not enough values to unpack (expected 2, got 1