diff options
Diffstat (limited to 'source/lang/for.rst')
-rw-r--r-- | source/lang/for.rst | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/lang/for.rst b/source/lang/for.rst index 6b00d7a..71c5aca 100644 --- a/source/lang/for.rst +++ b/source/lang/for.rst @@ -2,14 +2,8 @@ .. _lang-for: -for Loops -========= - -.. contents:: Contents - :local: - -Description ------------ +``for`` +======= A ``for`` loop is used to repeat a block of statements enclosed in curly braces. ``for`` loops are useful for performing repetitive @@ -19,6 +13,12 @@ operations, and are often used in combination with :ref:`arrays *header*, which sets up the for loop, and then a *body*, which is made up of lines of code enclosed in curly braces. +.. contents:: Contents + :local: + +Syntax +------ + There are three parts to the ``for`` loop header: an *initialization* expression, *loop condition* expression, and a *post-loop* expression. The general syntax looks like this:: |