+ 4
What is the difference between for and while in python in performance?!
3 Answers
+ 19
For loop depends on the elements it has to iterate
But while loop depends on condition true or false
+ 2
On Both you can perform loop and get same results but for loop is used when you know a result will be fixed number but while loop is used when you have to take input from users and results are unknown that time you use while both give same results but for is shorter , clear and simple to use
+ 1
It's negligible. Use whichever you want to use.



