Write a Python program that uses a lambda function to square a given number. The function should return the squared number.
Example 1:
Input: 5
Output: 25
Example 2:
Input: 10
Output: 100
Use a lambda function to create an anonymous function that squares a number.
# Define the lambda function
square = lambda x: x ** 2
# Test the function
print(square(5)) # Output: 25
print(square(10)) # Output: 100
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.