Posts

python

Python Programming: Declare array from array import * array_name=array(typecode,[Initializer]) E.g.       a=array('i',[1,2,3,4]) Difference between try-except-else and try-except-finally try-except-else: if exception occurs except block is executed otherwise else block is executed try-except-finally: no matter exception occurs or not finally block is executed for sure Print in newline or add new line: a = '\nhello' print(a)  or print('\nhello') Python Exceptions List: BaseException  +-- SystemExit  +-- KeyboardInterrupt  +-- GeneratorExit  +-- Exception       +-- StopIteration       +-- StopAsyncIteration       +-- ArithmeticError       |    +-- FloatingPointError       |    +-- OverflowError       |    +-- ZeroDivisionError       +-- AssertionError       +...