It is very easy to invert keys and values with a list comprehension in python. Here is how.
Thanks to pybytes
Here’s a more concise example
ad = { 1 : "one", 2 : "two" } b = {a: b for b, a in ad.items()} print(b)
Subscribe to the newsletter for updates
Tkinter templates
My youtube channel
Twitter: @pythonprogrammi - python_pygame