Mar-09-2019, 03:57 PM
d = {}
a = "hello"
d['x'] = a,
print(d)Here's the result:{'x': ('hello',)}
Python created the item as a two-element list maybe?
Consider:
>>> print(d["x"][0]) helloDo you wonder what element 1 is... I do... anticipation...
IndexError: tuple index out of range
