input: Write a python function to predict age based on height using linear regression.
  assert len(predict_age([150, 160, 170, 180])) == 4
  assert isinstance(predict_age([150, 160, 170, 180]), list)
  assert all(isinstance(age, (int, float)) for age in predict_age([150, 160, 170, 180]))
output: def predict_age(heights):
      from sklearn.linear_model import LinearRegression
      import numpy as np
  
      # Sample data: height (in cm) and corresponding age (in years)
      height_data = np.array([140, 150, 160, 170, 180, 190]).reshape(-1, 1)
      age_data = np.array([10, 12, 14, 16, 18, 20])
  
      # Create and train the model
      model = LinearRegression()
      model.fit(height_data, age_data)
  
      # Predict the age for the given heights
      predicted_ages = model.predict(np.array(heights).reshape(-1, 1))
  
      return predicted_ages.tolist()