Forces you to write short blocks making the code more

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: struc=on (but may contain many) • Seman=cs: If the expression is true, BLOCK 1 is executed, otherwise BLOCK2 is executed 10 IndentaGon in Python indenta=on if BOOLEAN EXPRESSION : BLOCK1 else : BLOCK2 • Python uses indenta=on to delimit blocks of code   Most other languages use brackets • This forces you to write short blocks, making the code more readable 11 Boolean expressions • Recap: they are expressions, so they compute values • Boolean expression compute logic values (true/false) which are used for decision making • The elements of Boolean expressions are comparison operator...
View Full Document

This document was uploaded on 03/02/2014.

Ask a homework question - tutors are online