In the below string we have to get slipt the dict vals with the & and the keys are are LHS and their respective RHS are values in the dict.
Input
s = 'term=food&location=New York'
Expected Output
{term:'food', location:'New York'}
I've tried
a_dict = dict([s.strip('{}').split("&"),])
pairs=[item.split('=')for item in items]
d = dict(pairs)
Help me out
Thanks