input: Write a function to calculate the maximum revenue from a list of stock prices, where the revenue is defined as the maximum difference between any two prices in the list. The function should return the maximum revenue.
  assert max_revenue([10, 7, 5, 8, 11, 9])==6
  assert max_revenue([10, 4, 5, 7, 8, 3])==5
  assert max_revenue([9, 11, 5, 8, 7, 10])==5
  assert max_revenue([7, 6, 4, 3, 1])==0
  assert max_revenue([])==0
output: def max_revenue(prices):
      if not prices:
          return 0
      min_price = prices[0]
      max_profit = 0
      for price in prices:
          min_price = min(min_price, price)
          max_profit = max(max_profit, price - min_price)
      return max_profit