8. Pengenalan Python Programming Language Workshop HMTS 23022016

Introduction to Python

Why, How, Why not, etc.
Ahmad Junaidi

There are 241 list of programming
languages in the world

How to pick your first
Programming Language



Workshop : Selasa, 23 Feb 2016, Ged. F UNAND, oleh : Ahmad Junaidi,
MT, MEngSc

Computers and Programming


Turing provided an influential
formalization of the concept of

the algorithm and
computation with the Turing
machine.

Alan Turing,
(1912–1954)

"It is possible to invent a single machine which
can be used to compute any computable
sequence. "

Computer Programming


1940s:






1950s, 60s:




Object orientation (e.g. Simula, Smalltalk)
C

1980s:




FORTRAN, LISP, COBOL, BASIC

1970s:






Assembly language
The first programming language: Plankalkül

C++, Ada, Perl

1980s: (Internet)





Java
Python
C#
PHP

Programming Languages





Java: is a cargo ship. It’s
very bulky. It’s very
enterprise~y. It can also
carry a lot of weight. Will
carry a project, but not very
fun to drive.
PHP: is a bamboo raft. A
series of hacks held together
by string. Still keeps afloat
though.

Languages


C/C++: is a nuclear submarine. The
instructions are in 'Japanese', but all of the
hardware is optimized for performance.
Clumsy, in many aspects can be

dangerous, but it regularly goes where
other boats go when they have holes!

Languages


Python: Small boat with outboard engine. Easy
to learn, fun to ride, no need to have a license,
very Dutch. Kids love it! Many use it as a hobby.
Even if you don't know what you are doing, can't
cause much damage

Creator Python
Monty Python's Flying Circus
broadcast by the BBC from 1969 to 1974

Guido van Rossum

Born


31 January 1956 (age 60)
Haarlem, Netherlands

Nationality

Dutch

Alma mater

University of Amsterdam

Occupation

Computer programmer, author

Employer

Dropbox

Known for


Creating the
Python programming language

Awards

Award for the Advancement of Free
Software (2001)

He was employed by Google from 2005 until 7
December 2012

Python, a general purpose
programming language. It is
interpreted and dynamically
typed and is very suited for
interactive work and quick
prototyping,
while
being

powerful enough to write large
applications in Numpy, Scipy,
Matplotlib etc.

dwide, Feb 2016 compared to a year ago:
Position

Programming
Share
Language

Trend

1

Java

24.2 %

+0.3 %


2

Python

11.9 %

+1.2 %

3

PHP

10.7 %

-0.8 %

4

C#


8.9 %

+0.1 %

5

C++

7.6 %

-0.5 %

6

C

7.5 %

+0.1 %


7

Javascript

7.3 %

+0.3 %

8

Objective-C

5.0 %

-0.9 %

9

Swift

3.0 %

+0.4 %

10

R

2.9 %

+0.3 %

11

Matlab

2.8 %

-0.3 %

12

Ruby

2.3 %

-0.2 %

13

Visual Basic

1.8 %

-0.4 %

14

VBA

1.5 %

+0.1 %

15

Perl

1.1 %

-0.1 %

16

Scala

0.9 %

+0.2 %

17

lua

0.5 %

+0.0 %

© Pierre Carbonnelle, 2015

http://pypl.github.io/PYPL.html

Position
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

Programming
Language
SAS
COBOL
Scratch
ABAP
Fortran
Lisp
Scheme
Dart
Transact-SQL
Scala
Ada
Lua
Logo
RPG (OS/400)
Prolog
F#
OpenEdge ABL
Go
LabVIEW
Haskell
Bash
Erlang
Ladder Logic
PureBasic
Alice
(Visual) FoxPro
Apex
Rust
VBScript
ML

Ratings
0.984%
0.852%
0.794%
0.675%
0.668%
0.658%
0.648%
0.622%
0.621%
0.532%
0.529%
0.523%
0.431%
0.392%
0.374%
0.348%
0.320%
0.294%
0.289%
0.267%
0.237%
0.231%
0.216%
0.211%
0.202%
0.202%
0.199%
0.195%
0.186%
0.172%

http://pypl.github.io/PYPL.html

Python is now the most popular introductory teaching
language at Top U.S. Universities; MIT, Stanford
University, University of California, University of IIIinois,
Etc

Why Python
Readable code (If you understand English, you already
understand Python)
Easy to learn
If you know Python, you can work with almost any
Python with little effort
High-performance computing
Powerful
Python is broad
Python is fast
Python is free
Python is efficient
-

You are looking for a job, which language should
you learn?
I think the right answer is
Python

How to go abut learning...


First






Then




Ignore the details and focus on important principals!
Writing small programs is better than reading long
ones!
Find a few good on-line references and use them
often.
Take a fairly involved problem and write your own
program.

Later



If you are to write fairly long programs, details are
also important. Try to remember how, if not why.
Reading other people's well written code can help a
lot.

Python Language

Warnings do Matter
(not only errors)




A man is smoking a cigarette and blowing
smoke rings into the air. His girlfriend becomes
irritated with the smoke and says, "Can't you
see the warning on the cigarette pack?
Smoking is hazardous to your health!"
To which the man replies, "I am a programmer.
We don't worry about warnings; we only worry
about errors."

python
https://www.python.
org/

Tutorial
https://docs.python.org/2/tutorial/https://docs.python.or
g/2/tutorial/

python version
2. and 3.

Numerical Python

Numpy

Science python

Scipy

Graph for Python

Matplotlib
http://matplotlib.org/

Matplotlib

Basemap demo

http://matplotlib.org/1.5.1/examples/index.html

Integrated Development Environtment (IDE)
Tex Editor

PyScripter

free ide for
python
windows

DEMO

installing process

installing process

installing process

installing process

Installing Numpy, Scipy and
Matplotlib with pip install

installing process

pip install numpy
pip install Scipy
pip install matplotlib

Install module/package
pip install

make sure you are
connected to the
Internet

Good Luck! and Bon voyage!!