You are on page 1of 2

Chapter-4 Flow of Control

Typesof Statement in python

-> Empty Statement


-> Simple Statement
-> Compound Statement

Empty Statement-
The Simplest statement is the empty statement.

Simple Statement
Any single executable statement is a simple statement
name= input("Your Name")

Compound Statement

A compound statement represented a group of statement executed as a unit.

a= int(input("Enter The number"))

Statement flow control

Sequence Statement:- The Sequence Construct means are being executed sequentially.

Selection Statement:-The selection statement construct means the execution of


statement depending upon a conditional test.

if

if-else

if-elif-else

if Statement-The if Statements are the Conditional Statement in python and thse


implement selection constructs.

if conditional :
statement

if ch==' ':
print("Blank Value")

the if-else statement

The form of if statement tests a conditional and if the condition evalauates to


true, it carries out statement indented below if and in case conditional evaluates
to false, it carries out statements indented below else.

if expression:
statements
else :
statement

ex
Q1. write a program to check even and odd number.

a=int(input("Enter the number"))


if a%2==0:
print("Even Number")
else:
print("OddNumber")

You might also like