I have multiple variables. How can I create a dictionary using those variables such as keys are variable names and values of those variables are values of the dictionary?
E.g.
From
a=10
b=20
c=30
to
{'a': 10, 'b': 20, 'c': 30}
You can apply dict() to those variables to create a dictionary.
Here is an example:
>>> a=10>>> b=20>>> c=30>>> dict(a=10, b=20, c=30){'a': 10, 'b': 20, 'c': 30}