Write it in front.
From the 08 touch python to now, intermittent use, to today Python has become a daily thing processing, scientific research experiments, and even the main language of the project, mainly because of its agility and fast implementation of the ability. Although read some of the Python tutorial, in addition to the original "Python core programming" has been repeatedly looked at, the rest has not seen very can make their own Python level improve the book, although also mastered some of the more pythonic method, but always feel away from the real deep understanding and use is still very far, It's like being an amateur, not a professional team. Until recently in the "write high-quality code-improve the Python program 91 recommendations" and "Python development Combat", began a bit of a bright feeling, so, take this opportunity, in the process of learning to read some interesting pythonic code to make a record, but also convenient for later review.
Code style and specification
1. Packages and modules are named in lowercase, singular, and short;
2. Packages are usually only used as namespaces, such as only empty __init__.py files;
Operator
1. Ternary operation
1 x=02 y=13printifelse y45 # equivalent to 6if x>y:7 print x 8 Else : 9 Print y
String manipulation
1. Formatting strings
1 #in the case of more arguments, this makes the formatted string clearer, especially if the argument is passed in Dict2 Print 'Hello% (name) s'% {'name':'Tom'}3 4 #using Str.format () can also make string formatting clearer5 Print '% (name) s is% (age) d years.'% {'name':'Tom',' Age': 12}
Python Deep Learning notes (i)