Csq supports most of control structures present in Python.
Be aware of the indentation, Csq doesn’t consider tabs as indents.
The if statement will execute a block of statements only when the condition is true.
a := 334
b := 334
if a == b:
print 'equal'
The output of the program will be:
equal
The else statement will execute a block of statements only when the condition is false.
a := 334
b := 3334
if a == b:
print 'equal'
else:
print 'not equal'
The output of the program will be:
not equal
The elif statement will execute a block of statements only when the condition is false and the condition of the elif statement is true.
a := 334
b := 3334
if a == b:
print 'equal'
elif a < b:
print 'done'
The output of the program will be:
done