Posts

Showing posts with the label conditional statement in python

CONDITIONAL STATEMENT PYTHON

Image
 A conditional statement(if...else) is very important in any programming language. if you have read my old post about how to write "HELLO WORLD " in python   , you know python is a very easy and very in demand programming language . And in python conditional statement (If.....else) is also very easy . Format of conditional statement :- In python conditional statement format is same as any major programming language.  here elif is new which is else...if together in python. The only thing you have to worry about is indentation as in python as python in a simple language which means it does not contain anything like curly brackets({}) and semi colons ( ; ) so you rather indent correctly while using python every time. Example of conditional statement in python :- As you can see that in the above example to check if variable b is greater than a , and rather easy than any other programming language . Thanks for reading, If find any improvement in this feel free to comment,...