Activity
Initialize a JSON array variable called products:
[
{"name": "Laptop", "price": 1200, "quantity": 5},
{"name": "Mouse", "price": 25, "quantity": 50},
{"name": "Keyboard", "price": 75, "quantity": 30}
]
Part 1 — Using Formatter: Convert the products array to CSV format using the Formatter tool. Log the CSV output to the Console.
Part 2 — Using Code Runner: Write Python code to calculate the total inventory value (price × quantity for each product, then sum them all). Return the result and log it to the Console.
Expected Output:
CSV Format:
name,price,quantity
Laptop,1200,5
Mouse,25,50
Keyboard,75,30
Total Inventory Value: 9500