input: Write a function to calculate the maximum revenue from an array of prices. The function should iterate through the list of prices, calculate the differences between consecutive prices, and return the maximum sum of any contiguous subarray of these differences.
  
  def max_revenue(prices):
      diff = [prices[i + 1] - prices[i] for i in range(len(prices) - 1)] 
      max_diff = 0
      for i in range(len(diff)): 
          for j in range(i + 1, len(diff) + 1): 
              current_diff = sum(diff[i:j]) 
              if current_diff > max_diff: 
                  max_diff = current_diff 
   
      return max_diff
  
  assert max_revenue([10, 7, 5, 8, 11, 9])==6
  assert max_revenue([100, 180, 260, 310, 40, 535, 695])==655
  assert max_revenue([7, 6, 4, 3, 1])==0
  assert max_revenue([])==0
output: def max_revenue(prices):
      if not prices:
          return 0
      diff = [prices[i + 1] - prices[i] for i in range(len(prices) - 1)]
      max_diff = current_diff = 0
      for d in diff:
          current_diff = max(d, current_diff + d)
          max_diff = max(max_diff, current_diff)
      return max_diff