If Else Statement in Python | Python Tutorial

Pubblicato il: 01 aprile 2021
sul canale di: Mahjabin Chowdhury
58
7

Assalamualaikum everyone.

In this video, I have discussed about if..else statement in python.
If else statement is a conditional statement.

In my previous video, I have discussed about if statement in python. If you are watching this video, I would highly recommend you to watch my previous part of this video to have a better understanding of if statement or conditional statement in python.

If statement is a conditional statement used to execute a certain block of code if a particular condition is satisfied.
If..else statement is a conditional statement used when there are multiple blocks of codes. And we can execute certain statements if condition is true and can also execute other statements if the condition is false.

Basically, if we use only if statement, we can execute a block of code only if the condition is satisfied.

But if..else statement allows us to execute either condition is satisfied or not satisfied.

If..else statement basically extends the if statement.


Below is the syntax of if..else statement:

if condition:
code1
else:
code2

Code1 gets executed if the given condition is True.
Code2 gets executed if the given condition is False.

In my video I have showed how you can execute a program which includes using if else statement. Watch the full video guys, so you can understand everything properly.

Thank you so much for being with me. Till we code again.


In questa pagina del sito puoi guardare il video online If Else Statement in Python | Python Tutorial della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Mahjabin Chowdhury 01 aprile 2021, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 58 volte e gli è piaciuto 7 spettatori. Buona visione!