Introduction
In this blog, I am going to explain about the If Else statement in Python. The output will be displayed in the Run module. If the condition is correct, it will display the output in the true statement.
Software Requirement
Python 3.5.2.
Simple Programming
- print("welcome To C#Corner.....")
- print("If Else Statements :")
-
- age=input("Enter Your Age :")
-
- if int(age)>=18:
- print("You Are Eligiable For Voting.....")
- else :
- print("You Are Not Eligiable For Voting...")
Explanation
In this blog, the output will be displayed as the correct condition, when the number is less than 18. It will display the second condition, when it is above 18:
Output
welcome To C#Corner.....
If Else Statements
Enter Your Age :21
You Are Eligiable For Voting.....
>>>
== RESTART: C:/Users/admn/AppData/Local/Programs/Python/Python35/ifelse.py ==
welcome To C#Corner.....
If Else Statements
Enter Your Age :16
You Are Not Eligiable For Voting...
>>>