input: Write a python function to calculate discount given price and discount rate.
  assert calculate_discount(100, 0.2) == 80.0
  assert calculate_discount(250.75, 0.15) == 213.14
  assert calculate_discount(50, 0.5) == 25.0
output: def calculate_discount(price, discount_rate):
      return price * (1 - discount_rate)