Python Condition & If else Statement

HEllO!!!!“Life isn’t about finding yourself. Life is about creating yourself.

Conditions

  • Equals: a == b
  • Not Equals: a != b
  • Less than: a < b
  • Less than or equal to: a <= b
  • Greater than: a > b
  • Greater than or equal to: a >= b

1)IF statement is written using IF keyword

fig

2)Else statement The else keyword print which isn’t print by the preceding conditions.

3) Indentation  (whitespace at the beginning of a line) 

4) The Elif keyword says “if the previous conditions is not true, then try this condition”.

5)Short Hand IF (we can write in one statement )

6) And (use to combine)

7) OR( use to combine)

8) Pass statement

9)Nested If( IF statement inside IF statement)

Thankyou friends #happy coding #have fun

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: