Question 1
Implement the function according to the docstring.
Square the given integer and clip the result to threshold (clipping means if the value x goes greater than the threshold, keep it at threshold).
Arguments:
x: int- the input numberthreshold: int- the threshold value
Return:
int- squared and clipped result
Your task
Implement this function:
def square_and_clip(x: int, threshold: int) -> int:
Write the function only — the arguments are read for you and the return value is printed automatically.
Arguments arrive as one Python literal per line, in this order: x, threshold.
Example
Input
3
5
Output
5