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 valueReturn:
int - squared and clipped resultImplement 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.
Input
3
5
Output
5
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 number - `threshold: int` - the threshold value **Return:** - `int` - squared and clipped result ## Your task Implement this function: ```python 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 ``` Implement the function according to the docstring. Given an even-length string of any case, create a string with the first half in lowercase and the second half in uppercase. **Arguments:** - `s: str` - the input string **Return:** - `str` - the modified string ## Your task Implement this function: ```python def lowercase_first_half_and_uppercase_second_half(s: str) -> str: ``` 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: `s`. ## Example **Input** ``` 'HelloWorld' ``` **Output** ``` 'helloWORLD' ``` Implement the function according to the docstring. Given an odd-length list, insert the middle element to both ends of the list. Modify the input list and do not return a new list. **Arguments:** - `l: list` - the input list **Return:** - `None` - the input list is modified inside the function. ## Your task Implement this function: ```python def add_the_middle_element_to_both_ends(l: list) -> None: ``` 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: `l`. ## Example **Input** ``` [1, 2, 3] ``` **Output** ``` [2, 1, 2, 3, 2] ```