Where will you use while rather than for?



Where will you use while rather than for?..

Answer / Suraj Singh

You would use the `while` loop instead of the `for` loop when you don't know how many iterations are needed to complete a task, or when you need to repeatedly execute a block of code until a certain condition is met. For example, in a game where the player can keep playing until they choose to quit.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

What is the encapsulation?

1 Answers  


What is none literal in python?

1 Answers  


Write a small code to explain repr() in python ?

1 Answers  


What is an operator in python?

3 Answers  


What are data frames, exactly?

2 Answers  


What is abstract class in python?

1 Answers  


What is the use of map in python?

1 Answers  


Do lists start at 0 or 1?

1 Answers  


Is python duck typed?

1 Answers  


How do you show hello world in python?

1 Answers  


What is a method call?

1 Answers  


What does time time () do in python?

1 Answers  


Categories