Compare a loop on a variable and a loop with a condition. What are the advantages and disadvantages of each of them?

A loop over a variable will always be executed a finite number of times, but in solving problems where the number of repetitions is unknown in advance, it is not applicable. A loop with a condition must be used carefully, you must make sure that there is no endless looping.

Remember: The process of learning a person lasts a lifetime. The value of the same knowledge for different people may be different, it is determined by their individual characteristics and needs. Therefore, knowledge is always needed at any age and position.