Conditional Statements: Decision-
making in Programming
Boolean Values and Relational Operators
• Boolean values: true or false
• Relational operators: == , != , > , < , >= , <=
Control Flow with If Else Statements
• if statement: executes code when the condition is true
• else statement: executes code when the condition is false
• if-else statement: evaluates the condition and executes one block of
code
Using Multiple Conditions with Logical Operators
• Logical operators: and , or , not
• and : returns true if both conditions are true
• or : returns true if at least one condition is true
• not : reverses the boolean value of the condition
Comparing Numbers with User Input
• Get user input with input() function
• Convert input to integer or float with int() or float() functions
• Compare user input to pre-defined values using relational operators
making in Programming
Boolean Values and Relational Operators
• Boolean values: true or false
• Relational operators: == , != , > , < , >= , <=
Control Flow with If Else Statements
• if statement: executes code when the condition is true
• else statement: executes code when the condition is false
• if-else statement: evaluates the condition and executes one block of
code
Using Multiple Conditions with Logical Operators
• Logical operators: and , or , not
• and : returns true if both conditions are true
• or : returns true if at least one condition is true
• not : reverses the boolean value of the condition
Comparing Numbers with User Input
• Get user input with input() function
• Convert input to integer or float with int() or float() functions
• Compare user input to pre-defined values using relational operators