Same code giving wrong output

My output is

5 3 2 …

6 7 4 … where as in the vide 2 and 4 are swapped

The link to my code is:

hi @namangarg2000 if you look carefully, that is not the only different digit in your answers, there are other changes as well. You can verify for each digit if it is correct or not. Or even better, submit it on hackerblocks

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.