Ifs and Booleans

if statements

Simplest form:

	if expression:
	    body

General form:

	if expression1:
	    body1
	elif expression2:
	    body2
	# ...
	elif expressionN:
	    bodyN
	else:
	    body

Compare:

	if sunny:
	    print("It's lovely out!")
	elif warm:
	    print("At least it's not cold.")

with:

	if sunny:
	    print("It's lovely out!")
	if warm:
	    print("At least it's not cold.")

Booleans

Boolean representation

Tips for writing code with booleans