Partition list into two lists: elements satisfying a threshold and the rest. Example: [5,2,8,1], threshold=4 => ([5,8],[2,1])
Implement this function:
def partition(lst: list, threshold: 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: lst, threshold.
Input
[5, 2, 8, 1]
4
Output
([5, 8], [2, 1])