# data[].attributes.body
1. Control statement
2. if and its types

# data[].attributes.body
1) Control statements are used to control the flow of execution depending on specific condition 2)A)If statement                                          if condition:
statement                                    [statements]
B)if - else statement
if(condition):
statement1
else:
statement2
statement3
C) If-elif-else
if(condition1):
statement1
elif(condition2):
statement2
else:
statement3
eg:A)
books=3
if(books==3):
print("I have")
print("three books")
eg:B
a=20
if(a<200):
print("less than 200")
else:
print("more than or equal to 200)

eg:3
num=float(input("Enter a number:"))
if num==0:
print("Zero")
elif num<0:
print("Positive number")
else:
print("Negative number")

# data[].attributes.body
1.Control Statements are used to control the flow of execution
2.If statements is executed if the statement becomes true.
It is of 4 types:
a) if statements
b) if elif else statements
c) if else statements
d) nested if else statements
Syntax:
a) if condiion:
statement
eg: n=2
if n==2:
print ("books")

b) if condition:
statement
elif(condition 2):
statement
else(condition 30):
statement
eg: n=2
if n==2:
print("books")
elif n=3:
print("books 2")
else n=4:
print("books 4")

# data[].attributes.body
1.Control statements:
They are used to control the flow of execution depening of the specified logic/condition.
-Different types of control statements:
a)Decision making statements
b)Iteration statements
c)Jumb statements.

2.Decision making statements are divided into 4:
a)If statements
b)If-else statements
c)If-elif Else statements
d)Nested If else statements.

If statements :
Syntax:
if (condition):
statement

If  else Statements:
Syntax:
If (condition):
statement1
else:
statement 2

If elif else statement:
Syntax:
if(condition):
statement 1
elif (condition):
statement 2
else:
statement

If elif else statement example:
if(num==0):
print("It is zero")
elif(num>0):
print("Positive number")
else:
print("Negative Number")

Nested if else statement:
Syntax:
if(condition1):
(condition2):
statement 1
else:
statement 2
else:
statement 3

# data[].attributes.body
1)CONTROL STATEMENTS ARE USED TO CONTROL THE FLOW OF EXECUTION OF A PROGRAM.
2) A)if statement
syntax:
if condition:
statement
B) if else statement
syntax:
if condition:
statement 1
else:
statement 2
C) if elif else statement
if condition:
statement 1
elif condition:
statement 2
else:
statement 3
D) nested if statement
if condition 1:
if condition 2:
statement 1
else:
statement 2
else:
statement 3
example:
#Pgm
n=int(input("Enter any no:"))
if n==50:
print("No: equal to 50")
elif n>=50:
print("NO: greater than 50")
else:
print("No: less than 50")

# data[].attributes.body
1.control statements are used to control the flow of execution depending upon the specific conditions
2.types-if statements
If-else statements
If-elif-else statements
Nested if statements
If statements-syntax:
if condition:
Statement
[Statements]
If-else statements-syntax:
if ( condition):
Statement 1
else:
Statement 2
Statement 3
If-elif-else statements-syntax:
if(condition 1):
Statement 1
elif(condition 2):
Statement 2
else:
Statement 3
Nested if statements-syntax:
if(condition 1):
if(condition 2):
else:
Statement 1
else:
Statement 2
eg:
num=float(input ("enter a number"))
if num==0:
print("zero")
elif num>0
print("positive number")
else:
print("negative number)

# data[].attributes.body
1)Control statements are used to control the flow of execution of a program which depends on the specific condition
2)if,if-else,if-elif-else,Nested if
a)If statement
If condition:
statement
b)If-else statement
If condition:
statement 1
else:
statement 2
c)If-elif-else statement
if condition:
statement 1
elif:
statement 2
else:
statement 3
d)Nested if
if condition 1:
if condition 2:
statement 1
else:
statement 2
else:
statement 3
Example:
#Program to check if a number is greater than or less than 100
a=int(input("Enter a value"))
if(a<100)
print("less than 100")
else:
print("more than or equal to 100")

# data[].attributes.body
1.Control statements are used to control the flow of execution depending upon the specified condition or logic
2.if statement
if condition:
statement
if-else statement
if(condition):
statement
else:
statement2
3.if -elif-else statement
if(condition 1 ):
statement 1
elif(condition 2):
statement 2
else:
statement 3
4.Nested if - else statement
if(condition 1):
if condition 2:
statement1
else:
statement 2
else:
statement 3
Example:
a=int(input ("Enter a number"))
if a>=0
if a==0:
print("Zero")
else:
print("Positive no.")
else:
print("Negative  no.")

# data[].attributes.body
Control Statements : They are used to control the flow of execution depending on the specified condition or logic
If and its types :
1. If statement
Syntax :
If condition:
print statement
If(n>=0):
print(n,"is a positive number")
2. If else statement
Syntax :
If condition:
statement 1
else:
statement 2
statement 3

# data[].attributes.body
1) Control statement - They are used to control the flow of execution depending on specific conditions.
2) a) if statement syntax---
If (condition) :
Statement
b) if else statement syntax---
If (condition) :
Statement1
else:
Statement2
Statement3
c) if elif statement syntax----
If (condition1) :

statement 1
elif(condition2) :
statement2
else:
statement3
d) nested if syntax----
If (condition 1) :
If (condition2) :
Statement1
else:
Statement 2
else :
statement 3

# data[].attributes.body
1)Control statement are used to control the flow of execution depending on specific condition
2)if statement
If condition:
print  Statement
If(n>=0):
print(n,"is a positive number")

If else statement:
If condition:
Statement 1
else:
Statement 2
else
Statement 3
3)if-elsif-else
If condition:
Statement 1
elsif:
Statement 2

else
Statement 3

# data[].attributes.body
RONA BIJU
1) Control statements are used to control the flow of execution depending upon the specified condition/logic
*Different types of control statements:
a) Decision making statements
b)Iteration statements
c)Jump statements

2)There are 4 types of decision making statements:
A)if statements
B)if-else statements
C)if-elif-else statements
D)Nested-if-else statements
A)if statements
Syntax:
if (condition):
statement

B)if-else statements
Syntax:
if( condition):
statement 1
else:
statement 2

C)if-elif-else statements
Syntax
if(condition):
statement 1
elif(condition):
statement 2
else:
statement 3
D)Nested-if-else statement
Syntax:
if condition 1:
if condition 2:
statement 1
else:
statement 2
else:
statement 3
Ex:
num=float(input("Enter a number:"))
if num>=0
if num==0:
print("Zero")
else:
print("Positive number")
else:
print("Negative number")
OUTPUT
Enter a number :5
Positive number

# data[].attributes.body
3. If elif else statement
Syntax :
If condition 1:
Statement 1
elif condition 2:
Statement 2
else condition 3:
Statement 3
4. Nested if else
Syntax :
If condition 1:
If condition 2:
Statement 1
else:
Statement 2
else:
Statement 3

# data[].attributes.body
Examples :
1.If else
If(n>0):
print(n,"is a natural number")
else:
print(n,"is not a natural number")
2. If elif else
If(n==0):
print(n," is zero")
elif(n>=0):
print(n, "is a positive number")
else:
print(n, " is a negative number")
3. Nested if else
If(n==0):
If(n>=0)
print(n, "is a positive number")
else:
print(n,"is zero")
else:
print(n, "is a negative number")