Write this essay, is to see Vamei big capital of the Python Quick Tutorial study notes, with this encourage each other, link: http://www.cnblogs.com/vamei/archive/2012/09/13/2682778.html
"First Lesson"
1, use Python to write a HelloWorld small program, directly in the hello.py input
print ' Hello World '
2. Hello.py can also be written as an executable script, as follows:
# !/usr/bin/env python Print ' Hello World '
You also need to give executable permissions to the above code, as follows:
#chmod 755 hello.py
Command line execution:
#./hello.py
Lesson two basic data types
1. Variables do not need to be defined
A=10print aprint Type (a) output: 10<type ' int ' >
Type (): Built-in function that queries the type of the variable.
2. Recycle variable name
If you want a to store a different value, you do not have to delete A to assign a value directly to it.
A=1.5print A,type (a) output 1.5,<type, ' float ' >
Print can be followed by multiple outputs, separated by commas.
3. Basic Data Type
Integer, Float, Boolean (True/false), String (single and double quotes are available)
Python Basic Learning (1th day)