The Zen of Python (original, Chinese translation, interpretation)

The Zen of Python, by Tim PetersBeautiful is better than ugly.Explicit is better than implicit.Simple is better than complex.Complex is better than complicated.Flat is better than nested.Sparse is better than dense.Readability counts.Special cases

Stay away from Python's worst practices and avoid digging holes

Original link: http://blog.guoyb.com/2016/12/03/bad-py-style/Recently looking at some old aging systems, some of which have bad code habits left out of the pit, plus recently wrote a piece of bad code caused the server load soared, so take this

"Cute Python" reading notes (eight)

The best solution to the problem is to find the code that someone else has to solve a similar problem. Today, do some small exercises that can look back at what you have learned, and similar questions refer to someone else's code and modify it to be

[Little Turtle] Getting started learning Python Notes "Magic Method"

// __new__ (cls[,....]) // object instantiates the first method of the call, its first argument is this class, and the other parameters are passed directly to the __init__ () method // overriding the __new__ () method when you need to modify it on

Python installs and writes a simple verification code component (with node)

1. Install PythonDownload the response System version to the official website (for example, Windows here): https://www.python.org/downloads/windows/And then there's the "Next Step",2. RunningTo be able to run at the command line like node, first

Python little exercise, using dict, to do a simple login.

‘‘‘Using a dictionary to implement login‘‘‘users=[{' username ': ' Jerry ', ' pwd ': ' 123456 '},{' username ': ' Tom ', ' pwd ': ' 1 '}def login (username,pwd):Print (USERNAME,PWD)if (username== "or pwd=="):return 0ElseIsbool=trueFor Dict1 in Users:

"Cute Python" reading notes (ix)

KISS is kingly!KISS = = Keep It simple,stupidNo matter what, stick to the simple process/principle/structure/code, is comfortable!Now small white want to use multi-threading to improve the speed of queries, using threading module!# -*- coding: utf-8 

Python 1 day

Python Basics-Basics1. The first python-suffix name can be arbitrary?-When importing a module, if it is not a. py file==> after the file suffix name is. py2. Two modes of executionPython interpreter py file pathPython enters the

Operation of the Python string

Concatenation of stringsa = "hello"b = "klvchen"c = a + bprint(c)结果:helloklvchenNote: This method is less efficient, and it is recommended to use the Join methoda = "hello"b = "klvchen"c = " ".join([a, b])print(c)结果:hello klvchenVarious methods of

Learn Python Lesson Two: User interaction programs

Author:uljfangbr/>e-mail:[email protected]time:2018-3-25Requirements:1. User input related information2. Print out the following format:----------Info:name----------NAME:Age:JOB:SALARY:#! usr/bin/env

Python Learning note-day2-dict,tuple, string common functions

The basic method of a list of Python, which goes on to say dict,tuple.One, tuple, tuple1, the definition of the tupleOr:2. Use slices to access elements in tuplesDetailed reference to the slice usage of list3, the tuple is not modifiable, is

Python's JSON module

  Import JSONdata={ "No": 1, "Name": "Runoob", "url": "Http://www.runoob.com"}The Json_str=json.dumps (data) # json.dumps () function encodes the data and converts it into JSON-formatted dataPrint ("Python raw Data:", repr (data))Print ("

Python container, iterator, generator

1. Containers, iterative objects, iterators, generator concepts1. Container: A data structure that stores many elements. Usually stored in memory (iterators, generators are special cases) can use in to determine whether an element exists in the

Learn the python first lesson variable

Author:uljfangbr/>e-mail:[email protected]Time:2018-3-24message="Hello , Python World!"print("message")message="Hello, Python World! This language is Cool to learn well."print("message")RunHello, Python world!Hello, Python world! This language are

Python First week study notes (2)

mul

Problem solving 0. Print less than 10 even: bit operationfor i in range(10): if not i & 0x01: print(i)1. Given a positive integer that does not exceed 5 bits, it is judged by a few (using the Input function) method one: normal

Pip in Python

Often in the process of installing software with PIP installation, then I always feel that Pip is for Linux and Mac, so I never studied Pip carefully, and then used Python to know that Pip is so useful Summarize the usage of PIP today My

Python Job 1: python job

Python Job 1: python job 1. Use the while LOOP input (numbers from 1 to 10) to print 1 2 3 4 5 6 8 9 10 Running result:   2. Calculate the sum of all numbers from 1 Running result:   3. Output all the even numbers in 1-100 Running

Python: Class, pythonclass

Python: Class, pythonclass Like JavaScript, Python is a process-oriented language, an object-oriented language, and a dynamic language. In most object-oriented languages, Class is essential. Object-oriented has three main features: encapsulation,

Python json module and pythonjson Module

Python json module and pythonjson Module    Import jsonData = {"No": 1,"Name": "Runoob ","Url": "http://www.runoob.com"}Json_str = json. dumps (data) # The json. dumps () function encodes the data and converts it into json-formatted data.Print

For the list sorting method with the element as the dictionary, sort the element dictionary list

For the list sorting method with the element as the dictionary, sort the element dictionary list Existing list such List_to_be_sorted = [{'lv': 44, 'age': 10 },{'Lv': 12, 'age': 39 },{'Lv': 88, 'age': 22 },{'Lv': 6, 'age': 2 },{'Lv': 3, 'age':

Total Pages: 4013 1 .... 1699 1700 1701 1702 1703 .... 4013 Go to: GO

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.