Why do we use three curly braces in a for loop. Is it necessary.. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why do we use three curly braces in a for loop. Is it necessary..

23rd Nov 2017, 9:38 AM
Anjali Kushwaha
Anjali  Kushwaha - avatar
2 Answers
+ 5
They just show which part of the code should be executed with the for loop!
23rd Nov 2017, 12:32 PM
᠌᠌Brains[Abidemi]
᠌᠌Brains[Abidemi] - avatar
+ 4
The curly brackets suggest that everything contained inside the brackets is part of the loop. Without them, it'd be hard to tell where the loop ends.
23rd Nov 2017, 11:00 AM
Bagshot
Bagshot - avatar