Lesson 7
Lesson 7
Lesson 7
if statement
if-else statement
if-elif-else ladder
Output
Nesting Conditions
Syntax
Output
The elif is short for else if. It allows us to check for
multiple expressions. If the condition for if is False , it
checks the condition of the next elif block and so on.We
can further refine the code using the elif keyword so we
can check for more than one condition.
Syntax
Output
Logical Operators
Syntax Output
Comparing with the in Keyword
Say we want to check a letter if it
is a vowel or not. We can
manually set multiple
conditions using if, elif, and else:
Tuples
Lists
Sets
Dictionaries
Break and Continue
The break keyword is used when you want to loop
something indefinitely until a condition is met.
Syntax Output
Syntax
Output
Simple Guessing Game