CONDITIONAL STATEMENT

Published on Slideshow
Static slideshow
Download PDF version
Download PDF version
Embed video
Share video
Ask about this video

Scene 1 (0s)

i f (Conditional Execution) i f-else (Alternative Execution) i f- elif -else (Chained Conditional Execution) Nested conditionals.

Scene 2 (8s)

If Conditional Execution. 1/4/2021. S.SATHISH, AP/CSE - SRIET.

Scene 3 (24s)

Example Program:. 1.Checking pass or fail:. a=int(input(Enter the number).

Scene 4 (56s)

If the condition is true, then body of if statement will be executed..

Scene 5 (1m 16s)

Example: 1. Odd or Even. Program:. number = int(input(Enter the Number).

Scene 6 (1m 49s)

Example: 2. Greatest of two numbers. Program:. a= int(input(Enter the Number).

Scene 7 (2m 20s)

1/4/2021. S.SATHISH, AP/CSE - SRIET. 7. Example: 3. Leap Year of Not 4. Positive or Negative Number 5. Eligibility for voting.

Scene 8 (2m 30s)

This is used to check more than one condition.. If the condition1 is False, it checks the condition2 of the elif block. If all the conditions are False, then the else part is executed..

Scene 9 (2m 51s)

1/4/2021. S.SATHISH, AP/CSE - SRIET. 9. condition_l Eal se rue False condition_2 Block statement_ 1 rue condition_n Block statement_2 rue Block statement_n default statement.

Scene 10 (2m 59s)

1. Traffic light Program:. Program:. colour =input(Enter the Colour of light).

Scene 11 (3m 28s)

2. Student Mark System:. Program:. mark=int(input(Enter the Mark).

Scene 12 (4m 1s)

Output:. Enter the Mark. 75. 1/4/2021. Grade = A.

Scene 13 (4m 12s)

One conditional can also be nested within another..

Scene 14 (4m 33s)

1. Greatest of Three Numbers:. Program:. a=int(input(Enter the value of a)).

Scene 15 (5m 6s)

Output:. Enter the value of a. 15. 1/4/2021. S.SATHISH, AP/CSE - SRIET.