All MicroEvals
Write a python function to check whether the given array is ...
Create MicroEval

Write a python function to check whether the given array is ...

Prompt

Write a python function to check whether the given array is monotonic or not. Your function should satisfy these tests: ```python assert is_Monotonic([6, 5, 4, 4]) == True assert is_Monotonic([1, 2, 2, 3]) == True assert is_Monotonic([1, 3, 2]) == False ```

Answer guidance

Reference solution: def is_Monotonic(A): return (all(A[i] <= A[i + 1] for i in range(len(A) - 1)) or all(A[i] >= A[i + 1] for i in range(len(A) - 1)))