Write a lambda function that takes two numbers and returns their product.
Example 1:
Input: 5, 3
Output: 15
Example 2:
Input: 7, 2
Output: 14
Lambda functions in python are a concise way to create functions. Use lambda to create a function that multiplies two numbers.
# Define the lambda function
multiply = lambda x, y: x * y
# Test the function
print(multiply(5, 3)) # Output: 15
print(multiply(7, 2)) # Output: 14
NOTEOwing to browser caching, any code input into the Trinket IDE might carry over across page refreshes or when transitioning between different questions. To commence with a clean slate, either click on the 'Reset Button' found within the IDE's Hamburger icon (☰) menu or resort to using Chrome's Incognito Mode.