4. What is computer programming?
Human write code,
which is commonly plain text,
in programming language;
and compile the code to binary format (sometimes);
and finally execute it.
CODE:
in plain text
written by human (commonly)
read and unstood by computer
5. What is a programming language?
Human communicate with human in human languages,
which include English, Chinese, Arabic, Maori, and many others.
Human teach computers how to work in programming languages,
which include C, C++, C#, Java, Python, R, Go, and mand others.
6. Python
a programming language
don’t need the process of compile
write in plain text
and then execute
If you are using a MacBook (Pro/Air),
you can start to practice, now!
7. Let’s play: “Hello, world”
Download “Sublime Text 2” from
http://www.sublimetext.com
Install and open it
Input text like this
Save as “helloworld.py” into your
home folder
Open “Terminal”
Execute the code
8. Branch: if … else ...
In Sublime, create a new file
save as “randominteger.py”
Input code like this:
In Terminal, execute it
Every time it executes, a random integer
between 0 and 20 will be generated
Then logic will go into different branch
9. Loop: draw a triangle
In Sublime, create a new file
Save as “drawtriangle.py”
Input code like this:
In Terminal, execute it
10. More about Python
Python is basicly everywhere.
Python can be used for:
Website server
Scientific computing
Handy tools
Many others ….
Who use Python?
11. More about “Hello, world”
“Hello world” is the most simple computer programme.
Learning of a new programming language typically begins with the
“Hello, world” programme in it.
YOU JUST BEGAN!
If you want learn more about python:
www.python.org
HAPPY JOURNEY