July 2017
Intermediate to advanced
354 pages
9h 58m
English
Conditional structures and loops will allow you to add advanced logic to your code. A conditional structure delimits a block of code that is executed only if a condition is met. Its syntax includes the reserved word if, and may include an alternative code block, for which we will use the reserved word else; that will be executed when the main condition is not met.:
x = 4if x>2 print "x value is bigger than two"else print "x value is not bigger than two"
As a result of the preceding code, you will see the string of the first print instruction by the print console as the value of "x is bigger than two".
Loops help us write blocks of ...