Aug-06-2020, 02:02 PM
I'm trying to understand the update method by adding a tuple to a dictionary. Can someone please the Traceback here? I was able to add a list of two tuples but not this one. Thanks!
>>> d {1: 'one', 2: 'two', 'y': 6} >>> tuplist2 (4, 9) >>> d.update(tuplist2) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: cannot convert dictionary update sequence element #0 to a sequence >>>