1.python assertion, can be very good to find an error in the place1 #-*-coding:utf-8 *-*-2 3 __metaclass__=type4 5 6 #Assertion7 defdemo ():8A = 59 assertA = = 5Ten assertA = = 4,'A is not equal to 5' One Print 'normal done' ADemo
0x 01 Dictionary IntroductionThe child and list are the two most common data types in Python, the dictionary is the data type of the key-value pair (key-value) format, it has the same index as the list, but not the subscript in the list, but the key
One, Hasattr (object, name)Determines whether an object has a Name property or a name method, returns a bool value, has the Name property or method returns True, otherwise returns false.>>> class Test (): ... Name= "Xiaohua" ... def run
One:Triangle = [[1], [1, 1]]num = 7for N in range (2, num): Pre = triangle[n-1] cur = [1] for J in range (0, n-1): Cur.append (Pre[j] + pre[j + 1]) Cur.append (1) triangle.append (cur) for i in Triangle:print ("* (6-int ( Triangle.index (i))),
In the use of Python to read the name of the Chinese catalog, there will be garbled Chinese problem, the problem is very serious, because the use of Os.path.isdir (' garbled name ') and Ospath.isfile (' garbled name ') are judged incorrect, are
From the beginning of this article, we will discuss the related functions of RABBITMQ in the next section. My articles are ultimately going to implement a project (specifically what is not disclosed). Each of the preceding articles is preparing for
AC Group: 522720170
Forwarding + likes = support
IntroductionRecently in the collation of the content of the Python Automation test course, found that Microsoft out of the VS code editor is too cool, very easy to use, and light weight do
Tuples: tuples are basically the same as lists, except that the values of tuples cannot be changed once created tup1= (1,2,3,4,5) print (tup1[2])-------------------------------------tuples contain only one element. You need to add a comma No comma
Some logins use cookies, some sign-in token authentication, token parameters generally have two forms, one is in the request header, one is to use the URL to pass the parameterHere is an example of how token is in the request
As usual, the original chain http://www.cnblogs.com/vamei/archive/2012/06/02/2531515.html#第一次接触面向对象, and there is no basis for C # say a long time did not go to see C's Tutorial # Remember C teacher said, object-oriented, process-oriented, not very
Creating a Python virtual environment under WindowsDescriptionBecause of the numerous versions of Python, there are also Python2 and Python3 debates, so some packages or third-party libraries are prone to version incompatibility issues.With
1. Download the installation package you need on the Python website: https://www.python.org/downloads/(two versions included)2. Download version python-2.7.3amd64.msi, after installing in Windows, you need to configure the path of the variable in
The recent network play "White nights chasing the fierce" in many friends of the recommendation, opened the mode of chasing the play, since the Langya list has not seen the domestic drama, this play is really a conscience drama! Have been chasing
IntroducedPsutil is a cross-platform library (http://code.google.com/p/psutil/) that makes it easy to get the process and system utilization (including CPU, memory, disk, network, and so on) information of the system running. It is mainly used for
Save the dictionary as a string into the text:1 #_*_coding:utf-8_*_2 #__author__ = "Csy"3info = {4 'name':'Csy',5 ' Age':' to'6 }7f = open ("Test.text","W")8 F.write (str (info))9F.close ()When opened again, the output will be a string:1 # _*
The dictionary is represented by curly braces {}, which is the most flexible built-in data type in Python. It is an unordered collection that accesses values by key and cannot be indexed.Creation and use of dictionariesThe composition of a
Overview
Both the xrange and range are basically used in the loop.
The xrange usage is exactly the same as range, and the difference is not a list object but a generator.
When generating a large sequence of numbers, using xrange will be much
In the regular expression, want to match some of the characters, that is to give a set of characters, as long as the occurrence of any of the set of characters, are set up, the following this article mainly introduces the use of the regular
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