Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
June 26, 2022 01:02 pm GMT

Overview of conditions in python.

1.Introduction
Conditions in python helps us in many ways as they are the block of code in which we can specify some condition in the code to be performed.
2.If
The if statement shows a code for a decision making statement. 'if' is the keyword and ended by ':' at the end.
syntax
Image description
The output for above example is
Image description
3.Elif
The elif condition means that if the previous condition is not satisfied then elif statement will be checked. The 'elif' is the keyword and ended by colon.
syntax


The output for above example is
Image description
4.Else
The else statement means that if the 'if' or 'elif' statement is not true then this will be correct.
Image description
The output for above example is
Image description


Original Link: https://dev.to/jindalkeshav82/overview-of-conditions-in-python-bjb

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To