Quick Sort IntroFast sorting, also known as partition Exchange sorting, pick an element from the unordered queue, split the unordered queue into two separate parts, one part of all data is smaller than the other part of all the data, and then
The first step, the implementation of input account password, display account welcome:Username = input ("Username:"= Int (input ("Password:") ) print("welcome ", username,"!!!!!!!!! ")The second step is to determine if the account password is
#-*-coding:utf-8-*-"""multi-threaded producer, consumers using queue queues"""ImportQueueImportThreadingImport TimeImportRandomqueue= Queue.queue (3)#Create a queue of 3 sizesclassProducer (Threading. Thread):"""producers, writing data to the queue""
Here is my collection of some Python tips, is mainly a number of practical functions, suitable for a certain basis of children's shoes to watch (will not specifically describe the use of the standard library functions).
One, function-type
Python data type1, int: ... .2, Bool:true False3, str: storage of small amounts of data ' Asjkdh ', ' Work search '4, List: lists, storage of large amounts of data [JHSSD, ' 1,2,3],123]5. Ganso: Read-only list ("SDFSD")6. Dict:
Work during the day, take time to study for a while, feel really limited energy, just start from the most basic learning, feeling understanding is still a bit difficult, today learned the format of output. Then the teacher knocked over the code
The RE module enables the Python language to have all the regular expression functionsTerminology Explanation:Pattern string:Optional flag parameters:' R ' is telling the compiler that this string is a raw string, do not escapeRe.match
To install a module for Excel operations:OPENPYXLBasic definitions in 1.excel
Workbook (Workbook): The entire Excel cousin file is called a workbook
Worksheets (sheet): multiple worksheets in a workbook
Activity Table (active sheet):
Given an array of integers, return indices of the both numbers such that they add-to a specific target.You may assume this each input would has exactly one solution, and you could not use the same element twice.Example :Given nums = [2, 7, one, +],
1. PrefaceThe collection set in Python is similar to a list in that the biggest difference is that duplicate elements are not allowed in the collection and are automatically de-weighed if they contain duplicate elements when defined.The collection
1. PrefaceFunctions are well-organized, reusable pieces of code that are used to implement a single, or associated function. Functions can improve the modularity of the application, and the reuse of the code.2. Definition of functionsThe following
Profile is used to obtain the time used by each function to provide a data support for optimization.
My PC environment Ubuntu 11.04 python2.7If an error is reported directly in Reference 2, we recommend that you use cprofile in the official
Subsections
Logs
Encoding
StringList and Dictionary
I. Logs
#! /Usr/bin/Python #-*-coding: UTF-8-*-''' created on @ Author: chenll Log Level notset
Console and test. log output:
2013-04-26 10:40:46, 381-log-Info-building table
Ii. Encoding
There
# Since this year we are going to conduct an email test, I will take a look at the e-mail's stuff and learn python. I always think that the explanatory language is a powerful tool for automated testing,
However, generally, scripting languages have
===== Python encoding ======
This paper mainly introduces the conversion between the encoding mechanism of Python, Unicode, UTF-8, UTF-16, GBK, gb2312, ISO-8859-1 and so on.
** Common encoding conversions are divided into the following situations :**
A dictionary corresponds to a list.
The dictionary is a set of unordered elements, so the offset is no longer used in the dictionary, instead of the key. It is a form of representation after data discretization. It uses a ing method to map keys to
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