Python
Concise syntax and support for dynamic input, combined with the nature of explanatory language, make it an ideal scripting language in many areas of most platforms, especially for fast application development features: Simple, easy to learn, free, open source, high-level language, portability, interpretive, object-oriented, extensible, Embeddable, Rich Library
Installation:
: https://www.python.org/downloads/Linux may have its own python, you can: Python- V to see if there is an environment variable installed after installing Windows under install when you choose to add to the environment variable: I have the following: C:\Program Files\python 3.5\scripts\; C:\Program Files\python 3.5\;
Learning: 1 How to run the program:
Two ways to run your program using Python-- Use the interactive prompt interpreter or use the source file 1 command line: Prthon, print "hello world "---> (before prompting you to add an environment variable already)-----Missing Parentheses in call to " ' the statement above does not work in Python 3. In Python 3 need to add parentheses around the value of be printed: different versions, missing brackets: print ( ' hello world ")
2 Integrated development Environment:
Click on the Ordered->python 3.5->idle (Python GUI)--- can be indented and written--run/f5
3 Data types
Number: integers, long integers, floating-point numbers, and complex strings: "" "," \ ", single quotes and strings inside double quotes, there are escape characters \ n The string is immutable, and the string prefix plus U is the unicode string: U' hehe ' Tip: There is no dedicated char data type, you can str[index] to get the regular expression operators that must be processed with natural strings:or-----! && | |
4 small Get----------* *
1 Double-click the Python script to run, the result flashed: At the end of the script add: If it is python3 to use input, if it is python2 will use raw_input such as: print ('Hello World' ); Input (); 2 command line invocation: Python C:\Program files\python 3.5Import os Os.system ("cls") 4 notes:#< /c16>
Control flow
The biggest difference between learning Python and other languages is that Python's code block does not use curly braces ({}) to control classes, functions, and other logical judgments. Python's most distinctive feature is the use of indentation to write modules. If---elseif --else while condition
Data:
Tuples: A set of elements that cannot be modified, c= (1,2,3,4,5) c1= (1,), C[index] to get elements of the element's value tuple's elements cannot be modified tuples using parentheses, the list uses square brackets: Length: Len (c) Copy: c=[2]*100 Loop: In (All in) function: Max (c) min (c)
List: A sequence is the most basic data structure in Python. Each element in the sequence is assigned a number- its position, or index, the first index is 0, the second index is the 1 list is the most commonly used Python data type, and it can be used as a comma-separated value within a square bracket the data item that appears in the list does not need to be created with the same type: list=[1,2, 'me', 3,4,'handsome'] gets: list[1]---2, list[1:3] 2 me,--- Delete:del list[3
Learn MORE:-----Python Introductory Tutorial
Http://www.cnblogs.com/foreverzd/p/4410331.html
Getting Started with Python (go)