Python tutorial part 16 :- python if statements

Python If Statements


 


The Python if statement is a statement which is used to test specified condition. We can use if statement to perform conditional operations in our Python application. The if statement executes only when specified condition is true. We can pass any valid expression into the if parentheses.

 

There are various types of if statements in Python.

if statement


if-else statement


nested if statement


 

Python If Statement Syntax

if(condition):  

   statements  

Python If Statement Example

a=10  


if a==10:  


        print  "Welcome to ApkZube"  


Output:

Welcome to ApkZube

No comments:

Post a Comment

Quick Tech