input: Write a python function to convert currency using given exchange rates.
  assert convert_currency(100, 'USD', 'EUR') == 88.333
  assert convert_currency(50, 'GBP', 'USD') == 65.765
  assert convert_currency(200, 'JPY', 'AUD') == 2.543
output: def convert_currency(amount, from_currency, to_currency):
      exchange_rates = {
          'USD': {'EUR': 0.88333, 'GBP': 0.765, 'JPY': 113.5, 'AUD': 1.4},
          'EUR': {'USD': 1.132, 'GBP': 0.865, 'JPY': 128.5, 'AUD': 1.587},
          'GBP': {'USD': 1.3153, 'EUR': 1.155, 'JPY': 148.5, 'AUD': 1.834},
          'JPY': {'USD': 0.0088, 'EUR': 0.0078, 'GBP': 0.0067, 'AUD': 0.0127},
          'AUD': {'USD': 0.714, 'EUR': 0.630, 'GBP': 0.545, 'JPY': 78.7}
      }
      
      if from_currency == to_currency:
          return amount
      
      if from_currency in exchange_rates and to_currency in exchange_rates[from_currency]:
          return round(amount * exchange_rates[from_currency][to_currency], 3)
      else:
          return None