If statement
suggest changeif condition:
body
The if statements checks the condition. If it evaluates to True, it executes the body of the if statement. If it evaluates to False, it skips the body.
if True:
print "It is true!"
>> It is true!
if False:
print "This won't get printed.."
The condition can be any valid expression:
if 2 + 2 == 4:
print "I know math!"
>> I know math!
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents