PDF版 ePub版

# 写一个简单的程序

## 程序

A computer program, or just a program, is a sequence of instructions, written to perform a specified task with a computer.[1] A computer requires programs to function, typically executing the program's instructions in a central processor.[2] The program has an executable form that the computer can use directly to execute the instructions. The same program in its human-readable source code form, from which executable programs are derived (e.g., compiled), enables a programmer to study and develop its algorithms. A collection of computer programs and related data is referred to as the software.

Computer source code is typically written by computer programmers.[3] Source code is written in a programming language that usually follows one of two main paradigms: imperative or declarative programming. Source code may be converted into an executable file (sometimes called an executable program or a binary) by a compiler and later executed by a central processing unit. Alternatively, computer programs may be executed with the aid of an interpreter, or may be embedded directly into hardware.

Computer programs may be ranked along functional lines: system software and application software. Two or more computer programs may run simultaneously on one computer from the perspective of the user, this process being known as multitasking.

## 写两个大字：Hello,World

Hello,World.是面向世界的标志，所以，写任何程序，第一句一定要写这个，因为程序员是面向世界的，绝对不畏缩在某个局域网内，所以，所以看官要会科学上网，才能真正与世界 Hello。

print "Hello,World"

## 解一道题目

#!/usr/bin/env python
#coding:utf-8

"""

19+2*4-8/2
"""

a = 19+2*4-8/2
print a

#!/usr/bin/env python

#coding:utf-8

"""

19+2*4-8/2
"""

"""

19+2*4-8/2
"""

# 开头的注释，可以像下面这样来写：

# 请计算：19+2*4-8/2

a = 19+2*4-8/2

print a