Important Notice:

Course Content
Conditional and Iterative Statements (Chapter-5) M3-R5.1
About Lesson
if Statement:-

            if Statement में जब expression true होता है तब वो अपने statement को execute होता है और अगर expression false होता है तब वो execute नहीं होता है।

Syntax

               if expression :                              if_statement(s)

or

if condition:    statement(s) 

Example

age =  int(input(“enter age ——- “))

if age >= 18:   

        print (“you are above 18 “) 

output 1 :-

enter age ——- 20                 # condition is true

you are above 18

 

if Statement:-

            In an if statement, when the expression is true then the statement is executed and if the expression is false then it is not executed.

Syntax

               if expression :                             

                      if_statement(s)

or

if condition:   

        statement(s)

 Example

age =  int(input(“enter age ——- “))

if age >= 18:   

        print (“you are above 18 “) 

output 1 :-

enter age ——- 20                 # condition is true

you are above 18

 

 

error: Content is protected !!