0
How can one identify loops
for loop and while loop
8 odpowiedzi
+ 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
+ 1
for(int i=0; i<8; i++){
}
while(running){
}
They can be identified by they initiations.
+ 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
}
+ 1
so can i get an example for in each loop to see the difference
+ 1
plz help me out # Burns
+ 1
hey i can't read through your examples
0
initiations like which one
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