input: Write a function to calculate the maximum revenue that can be obtained by selling items at different prices. The function should take a list of prices as input and return the maximum revenue. If the list of prices is empty, the function should return 0.
  assert max_revenue([10, 7, 5, 8, 11, 9]) == 6
  assert max_revenue([100, 180, 260, 310, 40, 535, 695]) == 865
  assert max_revenue([10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == 0
  assert max_revenue([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 9
  assert max_revenue([]) == 0
output: def max_revenue(prices):
      if not prices:
          return 0
      max_profit = 0
      min_price = prices[0]
      for price in prices:
          min_price = min(min_price, price)
          max_profit = max(max_profit, price - min_price)
      return max_profit