pythonreference.com

search statements, functions, methods, exceptions*

show categories

'if' statement
if test is True, enter the block
var = 3

if var > 0:
    print('higher')

print('continuing...')
initialize int if int is greater than 0: print str
The 'if' statement is used to execute a block of code if a condition ('test') is True. It follows these rules: 1) if the test in this statement is True, enter the block 2)if the test in this statement is False, skip to below the block 3) when the end of the block is reached, continue to the next line