adspace


Under what circumstances would one use a while statement rather than for ?

Answer Posted / Raja Singh

In Python's Django, while loops are often used when the number of iterations is not known beforehand or when a loop needs to continue until a certain condition is met. For example, if you're creating an application that fetches data from an API where the number of items may vary, a while loop would be more appropriate.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

No New Questions to Answer in this Category !!    You can

Post New Questions

Answer Questions in Different Category