input: Write a function to calculate the maximum possible revenue from items with given weights and values. Given the weights and values of items and a maximum capacity for the knapsack, the function should return the maximum revenue that can be obtained.
  assert knapsack([2, 1, 3], [4, 2, 3], 3)==7
  assert knapsack([3, 2, 1], [5, 3, 1], 3)==8
  assert knapsack([1, 2, 3], [1, 2, 3], 3)==6
  assert knapsack([], [], 0)==0
  assert knapsack([4, 5, 1], [1, 2, 3], 3)==3
output: def knapsack(weights, values, capacity):
      n = len(weights)
      dp = [0] * (capacity + 1)
      
      for i in range(n):
          for w in range(capacity, weights[i] - 1, -1):
              dp[w] = max(dp[w], dp[w - weights[i]] + values[i])
      
      return dp[capacity]