What are similarities between for loop and while loop please 50 points question
Answers
Answered by
1
Difference:
- while loop is condition dependent and does not necessarily need the content to be evaluated
- for loop requires content to iterate over
Similarity:
- both can iterate over a list or structure, but you must define your content to iterate through beneath the while condition whereas for loops define the content index and type at start
bayinarohit271:
thank you
Answered by
10
Answer :-
The similarities between for loop and while loop are :-
Both can iterate over a list or structure, but you must define your content to iterate through beneath the while condition whereas for loops define the content index and type at start.
Their similarity is that both "while" and "for" are used for repeating a loop
The similarities between for loop and while loop are :-
Both can iterate over a list or structure, but you must define your content to iterate through beneath the while condition whereas for loops define the content index and type at start.
Their similarity is that both "while" and "for" are used for repeating a loop
Similar questions