* Variable without prior declaration* variable does not need to specify type* Program Ape does not matter memory management* Variable name will be recycled*?del can release resources directly1.python uses a reference call instead of a value call,
Str.ljust (), Str.rjust (), Str.center () functionsFunction: Adjust the width of the string, and determine the string alignment;#可以用其它字符填充字符;#字符串长度 = number of strings (including spaces, punctuation, escape characters)Example one:#usage of str.ljust
Unit Test Module UnitTest
The four core concepts of unittest:
Testloader: A scheduler that loads or distributes test tasks;TestCase: The object of the test case;TestSuite: A container for multiple test cases;Texttestrunner: The worker
Life is short, I use python!This python quote, gave me the determination to learn python, always, I want to learn a program, whether it is a career or interest, I think it is necessary to learn.Once thought that Python is very simple, decided to
The current learning version is: python-3.6-4Code:1 """Integral type number"""2A = 2 * * 53b = A + 44c = A/45D = A//46E = a% 57F,g = 120,1128H = 3 + 4j9i = 4 + 8jTenj = h *I One Print(A,B,C,D,E,F,G,J) A - """String Type""" -str ='wo shi Zhang san!'
Chinese iso8859-1 encoding to UTF8 encodingStr.encode ("GBK"). Decode ('gbk '). Encode (' Utf-8 ' )Principle:UTF8 encoded text can be expressed in iso8859-1 encoding, but not in the reverse. Iso8859-1 is a single-byte encoding, and UTF8 is a
For each file in the 1,python2, the head must be added as soon as it appears in Chinese:#-*-Coding:uft8-*-Python3 no need to pay attention. Ascill Code 8 bits, accounting for one byte (8 bits), Unicode at least 16 bits, Utf-8 to 3 bytes, GBK to 2
1./Floating-point division, even if the numerator denominator is of type int, also returns float type, for example, we use 4/2, return 2.02.//Integer division, based on the different combinations of numerator denominator, returns a difference in
This time for you to use Python how to operate a PDF, the use of Python to manipulate the notes of the PDF, the following is the actual case, take a look.
The knowledge points involved
1, the use of urllib
2, the use of Reportlab library
This is a
This article is mainly for everyone to introduce the Python implementation of the Baidu speech recognition API, has a certain reference value, a need for friends can refer to
The example of this article for everyone to share the Ython to implement
This article mainly introduces the Python queue module, now share to everyone, the need for friends can refer to the next
In Python, queues are the most common form of exchanging data between threads. The queue module is a module that provides
This time to bring you python how to bulk merge Excel table, Python batch merge Excel table of note what, here is the actual case, take a look.
Merge cells
Merge cells I believe everyone will, for example, the following simple code can be
This article mainly introduces the sort method in Python, the need for friends can refer to the following
The sort () method in Python is used for array sorting, which is explained in detail in the example form:
First, the basic formThe list has
python can use the Python-docx module to work with Word documents, which are object-oriented.
Install: Enter PIP install python-docx on the cmd command line
Last hint successfully installed, indicating successful installation completed
Code:
#
This time for you to bring Python how to get greatest common divisor, Python to find greatest common divisor attention to what, the following is the actual case, together to see.
Before summarizing the greatest common divisor solution in Gartner
This time, bring us numpy. How to save and read the array, numpy array to save and read the considerations of what, the following is the actual case, take a look.
1. Arrays are saved in binary format
Np.save and Np.load are the two main functions
This time to bring you the Python numpy array How to merge, Python numpy array of considerations for the merger, here is the actual case, take a look.
There are many ways to merge numpy arrays in Python, such as
-Np.append ()-Np.concatenate
This time for you to bring Python to the two-dimensional array output as a picture of the method, Python to the two-dimensional array output as a picture of the attention of the matter, the following is the actual case, together to see.
For a
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