• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Part III: Appendixes > Logical Structures (Conditionals and Loops)

Logical Structures (Conditionals and Loops)

Logical structures allow us to determine whether certain statements are going to execute, and how many times they’ll execute. The two most commonly used kinds of logical structures are if-then statements and for-loops. Other kinds of logical structures, not covered here, include switch statements, while-loops, and do-loops.

Conditional Statements

A conditional statement evaluates a specified condition and determines which other statements to execute based on whether the condition evaluates as true or false. These are also sometimes called if-then statements. The basic syntax for a conditional can be one of the following:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint