Sunteți pe pagina 1din 63

Tuti Purwaningsih

Department of Statistics, Faculty of Mathematics & Natural Sciences


Gedung Prof Zanzawi Soejoeti, Fl 2, Universitas Islam Indonesia
Daerah Istimewa Yogyakarta

Email: tuti.purwaningsih@uii.ac.id
SCOPUS Author ID: 57193434157

Research areas: Big Data, Spatial Data Science, Geostatistics, Artificial Intelligence, Statistics

Bachelor of Statistics (S.Stat)


Statistics, Bogor Agricultural University, Indonesia

Master of Sains (M.Si.)


Grraduate School of Statistics, Bogor Agricultural University, Indonesia
What is computer?

A computer is an electronic device that


manipulates information, or data. It has the
ability to store, retrieve, and process data.
HOW DO HUMAN
COMMUNICATE WITH
COMPUTER?

A COMPUTER COULD NOT


UNDERSTAND HUMAN
LANGUAGE
EACH PROGRAM IS UNIQUE
Lets assume that a
programming
language is a vehicle.
There are many kinds
of vehicle, with
different size,
different characteristic
and different purpose.
COMPILED LANGUAGE
INTERPRETER LANGUAGE
ARTIFICIAL INTELLIGENCE
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/C hackers.
Python was originally conceptualized by
Guido van Rossum in the late 1980s as a
member of the National Research Institute of
Mathematics and Computer Science. Initially,
it was designed as a response to the ABC
programming language that was also
foregrounded in the Netherlands. Among the
main features of Python compared to the
ABC language was that Python had exception
handling and was targeted for the Amoeba
operating system (go Python!).
PYTHON GOALS!
In 1999, Guido van Rossum defined his goals for Python:
• an easy and intuitive language just as powerful as those of
the major competitors;
• open source, so anyone can contribute to its development;
• code that is as understandable as plain English;
• suitable for everyday tasks, allowing for short
development times.
Fun fact. Python is not
named after the
snake. It’s named after
the British TV show
Monty Python.
PYTHON HISTORY
WHY PYTHON?

Solve complex
problems in less
time with fewer
lines of code
HUGE CROSS-
HIGH-LEVEL
COMMUNITY PLATFORM

LARGE
ECOSYSTEM

WHY PYTHON?
WHY
PYTHON?
A multi-purpose language
with a simple, and beginner –
friendly syntax

WHY
PHTYON
PYTHON DRAWBACKS
• it's not a speed demon - Python does not deliver exceptional
performance

• in some cases it may be resistant to some simpler testing techniques -


this may mean that debugging Python's code can be more difficult than
with other languages; fortunately, making mistakes is always harder in
Python.
PYTHON DRAWBACKS

Despite Python's growing popularity, there are still


some niches where Python is absent, or is rarely seen:

• low-level programming (sometimes called "close to


metal" programming): if you want to implement an
extremely effective driver or graphical engine, you
wouldn't use Python;
• applications for mobile devices: although this
territory is still waiting to be conquered by Python, it
will most likely happen someday.
Python 2 vs Python 3

Python aka Cpyton


There is more
than one Cython
Python
Jython

Pypy and Rpython


Python 2 vs Python 3

• Python 2 is an older version of the original Python.


• Its has not been developed
• The updates are issued on regular basis, like fixing bugs and security holes
• Python 2's development path has reached a dead end already.
• Python 3 is the newer version of language
• These two versions of Python aren't compatible with each other.
• Python 3 is better than python 2
Basis of comparison Python 2.X Python 3.X

Function print print 9/4 print(9/4)


print “cta” print(“cta”)

Division of Integers When two integers are divided, Whenever two integers are
you always provide integer divided, you get a float value
value.

Not difficult to port python 2 Python version 3 is not


Backward compatibility to python 3 but it is never backwardly compatible with
reliable. Python 2.

Differences between Python 2


& Python 3
CPython:
CPython • Maintained by the people gathered around the
and PSF (Python Software Foundation)Python aka
Cpyton
Cython • These Pythons are called canonical
• Considered to be reference Pythons
• All Pythons coming from the PSF are written in
the "C" language.

Cython:

• Cython is a C extension of Python.


• Cython can call C functions.
"J" is for "Java".
Jython
Python written in Java

Jython can communicate with existing


Java infrastructure more effectively.
The current Jython implementation
follows Python 2 standards.
PyPy - a Python within a Python
PyPy
and
RPython A Python environment written in Python-like
language named RPython (Restricted Python).

A tool for people developing Python than for


the rest of the users.

PyPy is compatible with the Python 3


language.
For Windows user, start the downloaded .exe
How to get Python & file and follow all the steps.
https://www.python.org/downloads/
How to get to use it
• To start your work, you need the following
tools:
• an editor, to support in writing the code
• a console, to launch newly written code
How to get and stop it forcibly when it gets out of
control
Python & • a tool named a debugger, able to launch
your code step by step and allowing you to
How to get to inspect it at each moment of execution.

use it • Python 3 standard installation contains a very


simple but extremely useful application named
IDLE.
How to write and run your very first program
Click File in the IDLE’s menu and choose New file.
How to write and run your very first program
Click File (in the new window), then click Save as...,
How to write and run your very first program
Write : print(“Hello World”)
How to write and run your very first program
Click Run, then click Run Module (F5)
• Click File, Open, point to the file you saved
How to spoil and fix previously and let IDLE read it in.
• Remove the closing parenthesis.
your code
Sublime Text
• Sandbox allows Python code to be run in an Internet browser.
• The Sandbox interface consists of three main parts:
• the Editor window, which lets you type in your code,
• the Console window, which lets you see the output of your
programs,
• a tool named the Action Buttons bar, which lets you run your
code, refresh the editor window,
• and the Settings button, which lets you adjust display settings
and switch between Python/C/C++ environments.

Sandbox
Sandbox
https://edube.org/sandbox
Anaconda
Jupyter Notebook
Terima Kasih

S-ar putea să vă placă și