<

Watch Python Programming: If Statements

Posted on
13,106 Points
506 Views
6 Endorsements
Last Modified:
Community Pick: Many members of our community have endorsed this article.
Editor's Choice: This article has been selected by our editors as an exceptional contribution.
Experience Level: Beginner
2:22
Learn the basics of if, else, and elif statements in Python 2.7.

Video Steps

1. Use "if" statements to test a specified condition.


The structure of an if statement is as follows:
if <condition>:         
           do something

Open in new window

2. Use "else" statements to allow the execution of an alternative, if the first condition is not met


The structure of an if, else statement is as follows:
if <condition>:
         do something     
else:
         do something different

Open in new window

3. Use "elif" statements allow for the checking of multiple conditions.


The structure of an if, else, elif statement is as follows:    
if <condition>:
         do something     
elif <another condition>:
         do something different     
else:
         do something completely different

Open in new window

6
Author:Dototot
0 Comments
In an Exchange Crossforest migration, the distribution groups can be a very complex operation that would cause loss of time, lots of issues and continued headaches if not solved in a timely manner. I had to do a similar project so I created a sc…
Data can be kept in different media, Sometimes, the data need to be extracted, transformed or loaded in different ways. For this article, I'm going to demonstrate some of the popular ways of importing JSON data into MS SQL Server.
Next Video:

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month