A few days ago, I think Python simply can't, did not take notes carefully, and then today turned over the next few days to see things, or write down
For python2.7 and Python3, it is recommended to use the Python3 mode programming and then use the python2.7 package to run
1, head
Python file header is generally used to declare, a shell is somewhat similar, of course, Windows useless
#!/usr/bin/env python#encoding=utf-8
2, reserved child
The python reserved word has
>>>Import Keyword>>>keyword.kwlist['False','None','True',' and',' as','assert',' Break','class','Continue','def','del','elif','Else','except','finally',' for',' from','Global','if','Import','inch',' is','Lambda','nonlocal',' not','or','Pass','Raise','return','Try',' while',' with','yield']
3, Python controls the block of code by indenting it, so Python requires strict indentation,
Note that when EditPlus remotely connects to Linux, the TAB key is 8 bytes and there will be pits ...
4, Note:
# Single Comment " " " "
5, multi-line output
Total = Item_one + + item_three
6, data type
The Python data type has
Numeric type: int, float, bool, complex (plural) string type: String collection type: list, sets, dictionary, Tuple
Dict uses a special hash algorithm, so the query speed is almost constant no matter how many keys are.
7, import other modules
Import SYS from SYS import ARGV from sys import * # is not recommended for use
01-python Foundation