An if statement is a decision-making structure that contains a condition and a body of statements. If the condition is true, the body is executed. If the condition is false, the body is not executed.
Condition
A condition is an expression that evaluates to true or false.
Source & attribution
Introduction to Python Programming — If-else statements
OpenStax contributors · OpenStax, Rice University
CC BY 4.0. Text excerpted; whitespace normalised and empty cross-references removed; learning prompts added. No illustrations reproduced.
Source edition: 2024-07-30T19:17:56Z
A note to yourself
Create an account or sign in to keep private notes and saved takas across devices.