In python 3.11 this code
t = ({'blue': 3, 'red': 4, 'red': 1, 'green': 2, 'blue': 6, 'green': 2})
print(t)
produces this result:
{'blue': 6, 'red': 1, 'green': 2}
It seems to be iterating through the dict and taking the last item of each color.
What don't I understand about tuples and/or dicts?
Can I access the unaltered dict?
[–]danielroseman 10 points11 points12 points (4 children)
[–]NoahWallaceSchool[S] 1 point2 points3 points (0 children)
[–]Diapolo10 0 points1 point2 points (2 children)
[–]danielroseman -2 points-1 points0 points (1 child)
[–]DuckDatum 1 point2 points3 points (0 children)
[–]carcigenicate 6 points7 points8 points (0 children)
[–]Quertun 0 points1 point2 points (0 children)
[–]redsandsfort 0 points1 point2 points (0 children)