For loop or while loop

is for loop faster or while loop,since in the question we know when to stop we can use for loop instead of while?

Both should have negligible time difference, as they are inter-convertible. https://stackoverflow.com/questions/3629174/which-loop-is-faster-while-or-for
Just use the one which is easier to implement depending on the type of problem task at hand.

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.