Python is an interpreted, high-level and general purpose programming language. It is an open-source which make it freely usable and distributable, even for commercial use. Python was created by Guido van Rossum and first released in 1991. It supports multiple programming paradigms which are procedural, object-oriented and functional programming.
Python is used for:
The Python Package Index(PyPI) is used to hosts thousands of third-party modules for python.
Python is cross-platfrom programming language which work on different platforms like Windows, Mac, Linux, Raspberry Pi, etc. It has simple syntax easy to learn similar to english language. Python supports multiple programming paradigms. Python syntax allow developers to write programs in less code of lines than some other programming languages. Python is an interpreted language so that it make prototyping very quick.
Versions of Python:
print 'Hello, world!' raw_input('What is your name?\n') self.failUnlessEqual(median([2, 9, 9, 7, 9, 2, 4, 5, 8]), 7) # Unit testing with unittest copy[(size - 1) / 2] # access of a list index without casting to int xrange(BOARD_SIZE) # xrange exists cmp(1.0, 0.0) # cmp function exists iteratable.next() # list iteration itertools.ifilter(prime.__rmod__, iteratable) # itertools.ifilter is filter in Python 3
print('Hello, World!') input('What is your name?\n') self.assertEqual(median([2, 9, 9, 7, 9, 2, 4, 5, 8]), 7) # Unit testing with unittest, failUnlessEqual deprecated copy[int((size - 1) / 2)] # access of a list index needs casting to int range(BOARD_SIZE) # xrange was renamed to range in Python 3 #cmp needs to be implemented! def cmp(a, b): return (a > b) - (a < b) next(iteratable) # list iteration filter(prime.__rmod__, iteratable) # is itertools.ifilter in Python 2