I have a list of dictionaries like this:
l = [{'pet': 'cat', 'price': '39.99', 'available': 'True'},
{'pet': 'cat', 'price': '67.99', 'available': 'True'},
{'pet': 'dog', 'price': '67.00', 'available': 'False'}
,....,
{'pet': 'fish', 'price': '11.28', 'available': 'True'}]
How can I transform the above list into? (*):
l_2 = [('cat','39.99','True'),('cat','67.99','True'),('dog','67.00','False'),....,('fish','11.28','True')]
I tried to use .items() and l[1]:
for l in new_list:
new_lis.append(l.items())
However, I was not able to extract the second element position of the list of dictionaries into a list of tuples, as (*)