Write a lambda function that checks if a number is a multiple of another number.
Example 1:
Input: 10, 5
Output: True
Example 2:
Input: 7, 3
Output: False
Use a lambda function and the modulus operator.
# Define the lambda function
is_multiple = lambda x, y: x % y == 0
# Test the function
print(is_multiple(10, 5)) # Output: True
print(is_multiple(7, 3)) # Output: False
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.