The sys_info of the SYS module can return the current Python version information, whose return value is a tuple, such as (2, 6, 6, ' final ', 0);Indicates that the current version is 2.6.6, we can use the value of this variable to determine the
Python has a way to convert any value into a string: pass it to the REPR () or str () function.The function str () is used to convert a value into a form suitable for human reading, while REPR () translates into a form for the interpreter to
This article mainly introduces the following knowledge points:1. Subordinate checks of classes and objects2. Exception handling3. Reflection4. Single case modeSubordinate checks for classes, objectsCommand format: isinstance (obj, CLS)Description:
From the beginning to learn this piece of feeling blog is more difficult to write, it is not very likely to write blog problems are more serious. 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0012.gif "alt=" J_0012.gif "/>Can't think of
One, the print statement1.1 Basic output, automatic branch1.2 Print comma, you can join the previous content without wrapping, in a row1.3 >> Redirect, output to file print >> filename, "What to enter"Ii. Control Flow Statements2.1 consists of the
1. Python uses underscores as the variable prefix and suffix to specify special variables._xxx: No ' from module import * ' is generally considered private and is not available for use outside the module or class.__XXX__: System-defined Name__XXX:
The expression of a function is determined according to a given linear function:ExamplesGet_function ([0,1,2,3,4]) = f (x) =xGet_function ([1,4,7,10,13]) = f (x) =3x+1Get_function ([0,3,6,9,12]) = f (x) =3xLimit the length of the array to 5.Words
======#字符串格式化符号含义 #%c formatted string and its ASCLL code >>> '%c '%97 ' a ' >>> '%c '% ' a ' >>> '%c%c%c '% (97,98,99) ' A B C ' # %s formatted string >>> '%s '% ' I love python programing "I love Python programing ' #%d formatted integer >>> '%d +%
Object orientedclass Person (object): -- classesdef __init__ (self,name): -- Initialization function construction methodSelf.name = name --print '---Create: ', namedef say_name (self): -- methodprint ' My name is%s '%self.nameP1 =
Source of the topic
https://leetcode.com/problems/multiply-strings/Given numbers represented as strings, return multiplication of the numbers as a string.Note:the numbers can be arbitrarily large and is non-negative.
Test instructions
Closed Package
Closed Packagefunctions defined inside a function are the same as externally defined functions, except that they cannot be accessed externally:1.def g():2. print‘g()...‘3.def f():4. print‘f()...‘5. return gMove
Process Control
Boolean valuetemp = True Temp = False
Compare symbols= = = >=
and or non-And Or not
Comparison of mixed Booleans(4
Process Control elementsConditional statement if Elsecode block
Program execution
The Python string key has the following points:1. Some quotation-delimited charactersYou can see the string as a Python data type, a character array between a Python single quote or a double quotation mark, or a sequential character set. The most
Any (iterable)All (iterable)Any () differs from the all () function, any is arbitrary, and all is all.Version: This function is suitable for version 2.5 and above, compatible with Python3 version.Any (iterable) Description: Parameter iterable: can
Use Sicpy.io. Sicpy.io provides two functions Loadmat and Savemat, very convenient.There were also open source libraries (Pymat and PYMAT2, etc.) to do this,But since the numpy and scipy, these libraries have been abandoned.Here is a simple test
Update the Python version under Linux and modify the default version, as a friend can refer to.In many cases the server Python version is very low, you need to change the default Python version yourself1, download the Python installation package
Reprint Please specify source: http://www.cnblogs.com/codefish/p/5032753.htmlBefore I understand Python's package, class, and module, I've been referring to him as a dll,c# class, a reference to the namespace, which is actually different from C #,
[Python] Shell MD5 usage
MD5 should use a lot of algorithms. Let's talk about it with your own experience.
Scenario
There are still many articles on the algorithm layer on Wikipedia.
Mainly used scenariosPassword Storage is basically useless now.
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