Why do we use three curly braces in a for loop. Is it necessary.. | Sololearn: Learn to code for FREE!
Nowy kurs! Każdy programista powinien nauczyć się Generative AI!
Wypróbuj darmową lekcję
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 odpowiedzi
+ 5
They just show which part of the code should be executed with the for loop!
23rd Nov 2017, 12:32 PM
᠌᠌Code X
᠌᠌Code X - 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