input: Write a function to calculate the maximum revenue from a list of stock prices where each price represents the stock price on a different day. The program should return the maximum profit that can be achieved by buying and selling the stock once.
  
  def max_revenue(prices):
      if len(prices) < 2:
          return 0
      min_price = prices[0]
      max_profit = 0
      for price in prices:
          if price < min_price:
              min_price = price
          else:
              max_profit = max(max_profit, price - min_price)
      return max_profit
  
  assert max_revenue([10, 7, 5, 8, 11, 9]) == 6
  assert max_revenue([7, 1, 5, 3, 6, 4]) == 5
  assert max_revenue([7, 6, 4, 3, 1]) == 0
  assert max_revenue([1, 2, 3, 4, 5]) == 4
  assert max_revenue([2, 4, 1]) == 2
output: def max_revenue(prices):
      if len(prices) < 2:
          return 0
      min_price = prices[0]
      max_profit = 0
      for price in prices:
          if price < min_price:
              min_price = price
          else:
              max_profit = max(max_profit, price - min_price)
      return max_profit