How do I convert kwargs objects into local variables? I am a math teacher and I want to write a helper function where I can use JS-style template strings to write problems.
I want to do something like this:
TemplateString('{{a*b}} apples are shared among {{a}} children. How many apples do each child get?', {'a': 3, 'b': 5})
//return '15 apples are shared among 3 children...'
I am going to search for '{{}}' in strings and call eval() on what is inside that. But first I need to convert {'a': 3, 'b': 5} into local variables a=3 and b=5. The variables could be int, float or str. What is the best way to do this?