Difference between for loop and while loop in Python

Answer Posted / nashiinformaticssolutions

It is common practice to iterate through the items of different collection types, including List, Tuple, Set, and Dictionary, using the "for" loop. Developers employ a "for" loop in which the conditions are both the beginning and the conclusion. In contrast, the true looping feature found in all other programming languages is the "while" loop. Python while loops are used by programmers when they only have end conditions.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the pass statement in python?

534


Is python is easy?

541


How to import a module given the full path?

508


Which linux is best for python programming?

489


What does do in c?

520






What a blank curly brace initialize? A dictionary or a set?

620


What is print in python?

548


What is an operator in python?

524


Give one example for multiple statements in single statement?

511


What is difference between panda series and dictionary in python?

520


Tell me how does python handle the memory management?

523


What is an interpreter for python?

545


How do you escape a string in python?

509


What is python list function?

515


What is the difference between append() and extend() method in python?

498