input: 
  import flask
  from flask import Flask, request, jsonify
  import json
  
  app = Flask(__name__)
  
  @app.route('/countries', methods=['GET'])
  def get_countries():
      with open('data.json', 'r') as f:
          countries = json.load(f)
      return jsonify(countries)
  
  if __name__ == '__main__':
      app.run()
  
  """
  Create a basic REST API using Python and Flask that lists all the countries in the world.
  
  >>> import requests
  >>> response = requests.get('http://127.0.0.1:5000/countries')
  >>> response.status_code
  200
  >>> response.json()[:2]
  ['Afghanistan', 'Albania']
  """
  
output:     
  @app.route('/countries/<country_name>', methods=['GET'])
  def get_country(country_name):
      with open('data.json', 'r') as f:
          countries = json.load(f)
      for country in countries:
          if country['name'].lower() == country_name.lower():
              return jsonify(country)
      return jsonify({'error': 'Country not found'}), 404
  