Aug-06-2020, 02:15 PM
(This post was last modified: Aug-06-2020, 02:15 PM by Gribouillis.)
Here is the documentation of dict.update
You could use
Output:D.update([E, ]**F) -> None. Update D from dict/iterable E and F.
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k]
If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v
In either case, this is followed by: for k in F: D[k] = F[k]
In your case, E = (2, 9) so we are in a case of a sequence that lacks a .keys() method, and the function expects a sequence of pairs, not a sequence of integers.You could use
[(2, 9)]
instead of (2, 9)