a glance at computer programming
Transcript of a glance at computer programming
![Page 1: a glance at computer programming](https://reader036.fdocuments.us/reader036/viewer/2022062503/58f08eba1a28abdc2d8b462d/html5/thumbnails/1.jpg)
A GLANCE AT COMPUTER PROGRAMMING
REX JUNSHU WANG @ GIE8 23RD OCTOBER 2015 @ AUT
![Page 2: a glance at computer programming](https://reader036.fdocuments.us/reader036/viewer/2022062503/58f08eba1a28abdc2d8b462d/html5/thumbnails/2.jpg)
![Page 3: a glance at computer programming](https://reader036.fdocuments.us/reader036/viewer/2022062503/58f08eba1a28abdc2d8b462d/html5/thumbnails/3.jpg)
![Page 4: a glance at computer programming](https://reader036.fdocuments.us/reader036/viewer/2022062503/58f08eba1a28abdc2d8b462d/html5/thumbnails/4.jpg)
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 textwritten by human (commonly)read and unstood by
computer
![Page 5: a glance at computer programming](https://reader036.fdocuments.us/reader036/viewer/2022062503/58f08eba1a28abdc2d8b462d/html5/thumbnails/5.jpg)
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.
![Page 6: a glance at computer programming](https://reader036.fdocuments.us/reader036/viewer/2022062503/58f08eba1a28abdc2d8b462d/html5/thumbnails/6.jpg)
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!
![Page 7: a glance at computer programming](https://reader036.fdocuments.us/reader036/viewer/2022062503/58f08eba1a28abdc2d8b462d/html5/thumbnails/7.jpg)
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
![Page 8: a glance at computer programming](https://reader036.fdocuments.us/reader036/viewer/2022062503/58f08eba1a28abdc2d8b462d/html5/thumbnails/8.jpg)
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
![Page 9: a glance at computer programming](https://reader036.fdocuments.us/reader036/viewer/2022062503/58f08eba1a28abdc2d8b462d/html5/thumbnails/9.jpg)
Loop: draw a triangle
In Sublime, create a new file Save as “drawtriangle.py” Input code like this:
In Terminal, execute it
![Page 10: a glance at computer programming](https://reader036.fdocuments.us/reader036/viewer/2022062503/58f08eba1a28abdc2d8b462d/html5/thumbnails/10.jpg)
More about Python
Python is basicly everywhere.
Python can be used for: Website server Scientific computing Handy tools Many others ….
Who use Python?
![Page 11: a glance at computer programming](https://reader036.fdocuments.us/reader036/viewer/2022062503/58f08eba1a28abdc2d8b462d/html5/thumbnails/11.jpg)
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
![Page 12: a glance at computer programming](https://reader036.fdocuments.us/reader036/viewer/2022062503/58f08eba1a28abdc2d8b462d/html5/thumbnails/12.jpg)
Interesting: Programming Language Logos
![Page 13: a glance at computer programming](https://reader036.fdocuments.us/reader036/viewer/2022062503/58f08eba1a28abdc2d8b462d/html5/thumbnails/13.jpg)
Q & A
THANKS