3. History Of Python
• Python was conceived in the late 1980s, and its
implementation began in December 1989 by Guido van
Rossum at Centrum Wiskunde & Informatica (CWI) in the
Netherlands as a successor to theABC language (itself
inspired by SETL) capable of exception handling and
interfacing with theAmoeba operating system. Van
Rossum remains Python's principal author. His continuing
central role in Python's development is reflected in the title
given to him by the Python community: Benevolent
Dictator For Life
4. Guido Van Rossum
On the origins of Python, Van Rossum
wrote in 1996:
...In December 1989, I was looking for a
"hobby" programming project that would
keep me occupied during the week
around Christmas. My office ... would be
closed, but I had a home computer, and
not much else on my hands. I decided to
write an interpreter for the new scripting
language I had been thinking about
lately: a descendant of ABC that would
appeal to Unix/Chackers. I chose Python
as a working title for the project, being in
a slightly irreverent mood (and a big fan
of Monty Python's Flying Circus).
5. Releases
• Created in 1989 by Guido Van Rossum
• Python 1.0 released in 1994
• Python 2.0 released in 2000
• Python 3.0 released in 2008
• Python 2.7 is the recommended version
• 3.0 adoption will take afew years
7. Features
• Everything is anObject
• Interactive Shell
• Strong Introspection
• Cross Platform
• CPython, Jython, IronPython, PyPy
8. •CPython, Jython, IronPython, PyPy :-
PyPy, Cpython, Jython, IronPython are the
implementation of the python program language in
Rpython ,C, Java, C# respectively. Implementation
means what language was used to implement Python
and not how python code would be implemented. All
the implementations pretty much do the same thing.
Based on which implementation you use
9. Who Uses Python
• Google
• PBS
• NASA
• Library of Congress
• the ONION
• ...the list goes on...
33. Python’s Way
• No interfaces
• No real private attributes/functions
• Private attributes start (but do not end)
with double underscores.
• Specialclassmethods start andend with
double underscores.
• init , doc , cmp , str
34. Imports
• Allows code isolation and re-use
• Adds references to
variables/classes/functions/etc. into current
namespace
37. For Simple Matrix from Python
1- Import numpy as np,
2- A is = np.mat(0,1,2,1,0,3,4,5,6)
3-Print(“Value of matrix A”A)
Inverse Of Matrix From Python
1- Import numpy as np,
2- A is = np.mat(0,1,2,1,0,3,4,5,6)
3-Print(“Value of matrix A”A)
4- Inverse = np.linalg.inv (A)
5- Print (“inverse of matrix a” inverse)
39. Matrix Inverse of 3 x 3
>>>import numpy as np
>>>from scipy import linalg,
A=np.mat([1,3,5
2,5,1
2,3,8])
Linalg inv (A)
Array ([[0.48 0.36 0.88],
[0,56 o.o8 -0.36],
[0.15 0.12 0.04]]
Linalg det (A)
-25
40. 1- Import matplotlib.pyplot as plt
2-Plt.plot(np.random.randn(100))
3-plt.show()
Ploting of Matrix by Python
41. 3x + y =9
X+ 2y =8
C:/>python
>>>import numpy as np
a = np.array(((3,1),(1,2))),
b = np.array((9,8))
X = np.linalg (a,b)
Array ([2,3]) # solution x=2 ,y=3
>>>true
Linear Equation to Matrix