0

How can one identify loops

for loop and while loop

3rd Jan 2018, 10:00 PM
Okello Steve
Okello Steve - avatar
8 Answers
+ 1
on seeing of for and while keep words or based upon the continues iteration based upon a particular condition .. in this way we can identify loops
3rd Jan 2018, 10:17 PM
NAGANDLA.LEELA PAVAN KUMAR
NAGANDLA.LEELA PAVAN KUMAR - avatar
+ 1
for(int i=0; i<8; i++){ } while(running){ } They can be identified by they initiations.
3rd Jan 2018, 11:33 PM
LordHill
LordHill - avatar
+ 1
what they start with. while(){ This is a while loop. used to loop indefinitely until a condition is met. } for(){ This is a for loop. used to loop thru an array or run a certain amount of times }
4th Jan 2018, 10:52 AM
LordHill
LordHill - avatar
+ 1
so can i get an example for in each loop to see the difference
4th Jan 2018, 10:56 AM
Okello Steve
Okello Steve - avatar
+ 1
plz help me out # Burns
16th Jan 2018, 11:46 PM
Okello Steve
Okello Steve - avatar
+ 1
hey i can't read through your examples
18th Jan 2018, 10:01 PM
Okello Steve
Okello Steve - avatar
0
initiations like which one
4th Jan 2018, 10:05 AM
Okello Steve
Okello Steve - avatar
0
You just want an example of each type of loop? for i in range(10): print(i) that is a simple for loop run=True count=0 while run==True: count+=1 if count<10: print(count) else: run=False That is a simple while loop. Copy them
17th Jan 2018, 9:40 PM
LordHill
LordHill - avatar