Test cases failed

please help me to correct the code

even after odd means the nodes having odd values must be placed in front of nodes having even value. And the order of the nodes. must be preserved.
For ex. If the given input is
7
3 4 2 7 8 6 1
Then output will be
3 7 1 4 2 8 6
but your output is 1 7 3 4 2 8 6.

can you please check whats the error now

changes done but still two testcases failed

you are complicating your code for no reason, all you need to do is make 2 different lists for odd and even if the number is odd push it into odd list else push it into even list and then print odd list followed by even list

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.