Decision Control in Python
Decision Control in Python
Decision Control
② if
③ if else
④ if elif else
⑤ Single line if else
Controlstatemnt
Ñ→-
① decision control
→ if else
② match case
elif else
control
③ Iterative ↳
smgfehneifelse
egwerd
f;
Block
*
Clcttsava Python
if {
•
É ⑤
-
< indent
Write to check whether
a
program
number is
positive or non positive
a
given
))
"
( input (
"
a = int Enter a number
if a>0 :
)
" "
print ( Positive
if a < =o :
print (
"
Non Position
"
)
Keyword ifelse_
p
"F
if candi
E-
→ eh
keyword
]
a else
block
Write to check whether
a
program
number is
positive or non positive
a
given
a = int ( input (
"
Enter a number
"
))
if a> 0 :
)
"
print (
"
Positive
else :
"
Non Positive
"
)
print &
if elif else
if condition :
elif condition :
elif condition :
elif condition :
=
else
:=
Write to
print grade obtained
a
program
in a test .
Take marks obtained from
user and display the
grade .
A
90 < marks ≤ 100
90
B
80C marks ≤
C
80
70 < marks ≤
70 D
Go < marks ≤
≤ 60
E
50 < marks
F
be 10%50
Singhelineifelse
if condition else code 2
cadet
U
f- F
else
Write a python to check
program
whether number is positive
given
a
or non positive .
) )
"
"
"
number ) else Non Positive
( intinpntc >0
"
print
"
positive if Enter a
Nested if else
if condition :
else
:-,
=
else
:-,