The “for” Loop is generally used to iterate through the elements of various collection types such as List, Tuple, Set, and Dictionary. Developers use a “for” loop where they have both the conditions start and the end. Whereas, the “while” loop is the actual looping feature that is used in any other programming language. Programmers use a Python while loop where they just have the end conditions
Riya Answered question July 7, 2023
For loop is used to iterate over a sequence of items.
While loop is used to repeatedly execute a block of statements while a condition is true.
Sandhya Answered question June 26, 2023
