Posts

Showing posts from January, 2018

Control Flows From Python

     As Other Languages Python also has control flow Statements. They are as follows:- if Statement      It used to check condition according to it control program flow. Syntax: if condition: statement1 statement2 ... if..else Statement      It is used control flow according to condition, If condition evaluates to True, It will execute if block, else block otherwise. Syntax: if condition: statement1 statement2 ... else: statement1 statement2 ... Example: >>> a = 3 >>> b = 9 >>> if b > a: ...  print "B is Max" ... else: ...  print "A is Max" ...  B is Max if..elif..else Statement      Python Doesn't supports switch...case like C or Java, it is replaced with if - elif - else. It first checks if condition if it evaluates true it execu...