Writing Conditional Statements in Python | if | elif | else

Опубликовано: 14 Октябрь 2024
на канале: EdYoda
276
3

For more courses visit : https://www.edyoda.com/

In this video we will discuss how to write if, elif and else code block to execute the statements only when a certain condition is True and remember any non zero value is True in python. We will discuss indentation rule in python and how to write an indented block of code. In python indentation error is the most common syntax error, in this video, we will also see how you can resolve the indentation error.

Try it yourself:

Check if integer num1 = 45 is even or odd. if even print Even in console else print odd
Check if given list is empty or not. If list is empty print "List is empty" else print the original list
Check if given char = "a" is vowel or consonant.