If Else Statement in Python | Python Tutorial

Veröffentlicht am: 01 April 2021
auf dem Kanal: 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.


Auf dieser Seite können Sie das Online-Video If Else Statement in Python | Python Tutorial mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Mahjabin Chowdhury 01 April 2021 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 58 Mal angesehen und es wurde von 7 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!