input: Write a python function to calculate the distance between two geographic coordinates in kilometers.
  assert round(calculate_distance(48.8566, 2.3522, 40.7128, -74.0060), 1) == 5837.2
  assert round(calculate_distance(51.5074, -0.1278, 40.7128, -74.0060), 1) == 5570.2
  assert round(calculate_distance(35.6895, 139.6917, 34.0522, -118.2437), 1) == 8815.5
output: def calculate_distance(lat1, lon1, lat2, lon2):
      from math import radians, sin, cos, sqrt, atan2
  
      # Convert latitude and longitude from degrees to radians
      lat1, lon1, lat2, lon2 = map(radians, [lat1, lon1, lat2, lon2])
  
      # Haversine formula
      dlat = lat2 - lat1
      dlon = lon2 - lon1
      a = sin(dlat / 2)**2 + cos(lat1) * cos(lat2) * sin(dlon / 2)**2
      c = 2 * atan2(sqrt(a), sqrt(1 - a))
  
      # Radius of Earth in kilometers
      R = 6371.0
      distance = R * c
  
      return distance