One of the coolest things I've learned about python recently is that a dictionary can take parameters like this:
dict(red=3,blue=2,yellow=5)
How could I make a function that takes arguments in the same fashion and pass them to a dictionary? I don't want to declare red, blue, or yellow as individual parameters. Ideally, this would take in named parameters of any kind.
I've already tried:
def foo(*args):
...and it doesn't like how the parameters are named.
Another thought I had was extending the dictionary definition so I could still use init of the dictionary, but I wouldn't know how to do that either.