Python Deep Learning notes (i)

Source: Internet
Author: User

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.