input: Write a python function to add items to a grocery list and retrieve the list as a JSON string.
  assert add_item("Milk", 3) == None
  assert add_item("Bread", 2) == None
  assert get_list() == '[{"name": "Milk", "price": 3}, {"name": "Bread", "price": 2}]'
  assert add_item("Eggs", 5) == None
  assert get_list() == '[{"name": "Milk", "price": 3}, {"name": "Bread", "price": 2}, {"name": "Eggs", "price": 5}]'
output: import json
  
  grocery_list = []
  
  def add_item(name, price):
      global grocery_list
      grocery_list.append({"name": name, "price": price})
  
  def get_list():
      global grocery_list
      return json.dumps(grocery_list)