Generation

generate functionMon, 12 Dec 2022

Create a program that will take two lists of integers, a and b. Each list will consist of 3 positive integers above 0, representing the dimensions of cuboids a and b. You must find the difference of the cuboids' volumes regardless of which is bigger. For example, if the parameters passed are ([2, 2, 3], [5, 4, 1]), the volume of a is 12 and the volume of b is 20. Therefore, the function should return 8.

def find_difference(a, b): return max(a) * max(b) find_difference([1, 2, 3], [4, 5, 6])

Questions about programming?Chat with your personal AI assistant