If I have two different lists, such as:
list1= ['blue', 'green', 'purple']
list2 = ['circle', 'square', 'triangle']
Is there a way to convert them into a JSON object structure by using another list to determine attribute names?
For instance, if the attributes are defined as ['color', 'shape']
Then the result should look like:
final_result = [
{color: 'blue', shape: 'circle'},
{color: 'green', shape: 'square'},
{color: 'purple', shape: 'triangle'}]