Write a function is_positive_odd_or_negative_even that checks if an integer is either a positive odd number or a negative even number. Return True if the number meets one of these conditions; otherwise, return False.
NOTE: This is a function type question, you don't have to take input or print the output, just have to complete the required function definition.
0 --> False (neither positive nor negative)3 --> True (positive odd)-4 --> True (negative even)4 --> False (positive but even)-3 --> False (negative but odd)Implement this function:
def is_positive_odd_or_negative_even(n: int) -> bool:
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: n.
Input
0
Output
False
Write a function `is_positive_odd_or_negative_even` that checks if an integer is either a positive odd number or a negative even number. Return `True` if the number meets one of these conditions; otherwise, return `False`. **NOTE:** This is a function type question, you don't have to take input or print the output, just have to complete the required function definition. ### Example cases - `0` --> `False` (neither positive nor negative) - `3` --> `True` (positive odd) - `-4` --> `True` (negative even) - `4` --> `False` (positive but even) - `-3` --> `False` (negative but odd) ## Your task Implement this function: ```python def is_positive_odd_or_negative_even(n: int) -> bool: ``` 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: `n`. ## Example **Input** ``` 0 ``` **Output** ``` False ``` Write a function `within_and_has_double_quotes` that checks if a given string starts and ends with double quotes, and if there are double quotes inside the string (excluding the first and last characters). Return `True` if both conditions are met, and `False` otherwise. **NOTE:** This is a function type question, you don't have to take input or print the output, just have to complete the required function definition. ### Example cases - `"abcd"efgh"` --> `True` (starts and ends with double quotes, and has double quotes inside) - `'abcd"efgh"'` --> `False` (does not start with double quotes) - `"'abcd'efgh'"` --> `False` (uses single quotes) - `"abcdefgh"` --> `False` (no double quotes inside the quotes) ## Your task Implement this function: ```python def within_and_has_double_quotes(s: str) -> bool: ``` 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** ``` '"abcd"efgh"' ``` **Output** ``` True ``` Given a tuple `t` of odd length, and a positive integer `n`, replace the middle element with `n` copies of itself. **NOTE:** This is a function type question, you don't have to take input or print the output, just have to complete the required function definition. ### Examples For `t = (1, 2, 3, 4, 5)` and `n = 5`, the result should be `(1, 2, 3, 3, 3, 3, 3, 4, 5)`. For `t = (1, 2, 3)` and `n = 4`, the result should be `(1, 2, 2, 2, 2, 3)`. ## Your task Implement this function: ```python def replace_middle_with_n_times_middle(t: tuple, n: int) -> tuple: ``` 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: `t`, `n`. ## Example **Input** ``` (1, 2, 3, 4, 5) 5 ``` **Output** ``` (1, 2, 3, 3, 3, 3, 3, 4, 5) ```