Python if.elif.else Statements
The if…elif…else statement is used in Python for decision making.
i)if Statement:
Syntax:
Example:
ii)if...else Statement
Syntax:
Example:
iii)if...elif...else statement:
Syntax:
Example:
The if…elif…else statement is used in Python for decision making.
i)if Statement:
Syntax:
if test expression:if Statement Flowchart:
statement(s)
Example:
x = 10
if x > 0:
print(x,"is positive numner")
ii)if...else Statement
Syntax:
if test expression:if...else Statement Flowchart:
Body of if
else:
Body of else
Example:
x = 10
if x > 0:
print(x,"is positive numner")
else:
print(x,"is either zero or negative number")
iii)if...elif...else statement:
Syntax:
if test expression:if...elif...else Flowchart:
Body of if
elif test expression:
Body of elif
else:
Body of else
Example:
x = 10
if x > 0:
print(x,"is positive numner")
elif x < 0:
print(x,"is negative number")
else:
print(x,"is zero")
Thanks for providing such great and useful informations on your blog.update more data later.
ReplyDeleteHadoop Training in Chennai
Big data training in chennai
big data training in velachery
JAVA Training in Chennai
Python Training in Chennai
SEO Training in Chennai
hadoop training in Annanagar
big data training in chennai anna nagar
Big data training in annanagar
This comment has been removed by the author.
ReplyDeleteSimply wish to say your article is as astonishing. The clarity in your post is simply great, and I could assume you are an expert on this subject. Well with your permission let me grab your RSS feed to keep updated with forthcoming post. Thanks a million and please keep up the gratifying work.
ReplyDeleteSurya Informatics
This comment has been removed by the author.
ReplyDeleteThank you for this informative and helpful article. It really gave me a lot of information, hope that you’ll continue to create articles like this.
ReplyDeleteBest data science training institute in marathahalli
Spark Training in Marathahalli
Nice blog,Very useful article,Thanks for sharing this information.
ReplyDeleteSpark Scala Online Training
Good Blog,Thanks for sharing this informative article.
ReplyDeleteBig Data Hadoop Online Training | Big Data Hadoop Training | Hyderabad
Thanks for sharing..nice blog
ReplyDeletePython Online Training India
Python Online Training in India