# This is a learning note for the Liaoche teacher Python tutorial1 , binding methods for instances# define a function>>> def set_age(self, Age): # define a function as an instance method... self.age = age# Bind method for instance>>> from types
First, arithmetic operators+-*///(divisible by integer)% (take remainder) * *Second, the comparison character> = Third, part of the code: while num2>0:num =4 while num > 0: print ( " # " , End= ) num -=1 print () num2 -=1 Line =5 and
Overall Note: Ctrl +?1. Operators+-*///(pick-up)* * (Power)% (redundancy)Determine if something is contained in something: in NotNot equal to:<>!=A=a+1 equals A+=1.A=a-1 equals A-=1.a=a%1 equals A%=1.The result is a valueArithmetic operationsA = 10 *
Python Basics:Strings and encodings:In computer memory, Unicode encoding is used uniformly, and is converted to UTF-8 encoding when it needs to be saved to the hard disk or when it needs to be transferred.When editing with Notepad, the UTF-8
Accidentally deleted the previous shell script, the previous shell script because the extensibility is not strong, it is intended to use Python to re-implement.There are many methods of port scanning, and I am here to process the results into JSON
Python's functions and methods, defined by Def:Features of the function:
Reduce duplicate code
To make the program extensible
Make programs easier to maintain
The difference between a function and a method: The function has a
1. Python expresses data by object, so each object has an identity, type, value2, the identifier name, must be the English mother or the underscore beginning, cannot use the keyword3. Variable names are case-sensitive4. The eval () function gets the
Reference textLiaoche Python Tutorials
TCP is to establish a reliable connection, and both sides of the communication can send data in the form of a stream. The relative tcp,udp is a non-connection oriented protocol. when using the UDP
1. There are 4 ways to express a string:Single quote: "'Double quotes: "Three single quotes: "'Three double quotes: "" "or" "Content in quotation marks is the contents of a string2. The difference between single and double quotation marks:Double
Python, like most other languages, has local variables and global variables, but it does not have a distinct variable declaration. The variable is generated by first assignment and automatically dies out when it goes out of scope.Example 1. Defining
Subquery: A query statement enclosed in parentheses, as a condition of another query statement to use, become a subquery;1--subquery: A query statement enclosed in parentheses, as a condition of another query statement to use, called a
There are two ways to format a python string: percent-percent, format-method#%[(name)][flags][width]. [Precision]typecode# %s followed by direct add% after if S is the same as any type, D is followed by the integral typeof the gymTel ="I am%s
Tag: Set ATT value technology performs operation BSP subclass attrObject-oriented built-in methods (example)I, Isinstance (OBJ,CLS) and Issubclass (Sub,super)1. Check if BoJ is an object (instance)class Foo (object): Pass = Foo
I. Introduction to Python1.Python is an interpretive language, object-oriented language, simple syntax, a rich library of classes, more suitable for beginners.2. Relative to C/java and other languages, the operation speed is slightly slow, but the
1. atomicityAll operations in the entire transaction either commit successfully or all fail back, and it is not possible for a transaction to perform only a subset of the operations2. ConsistencyConsistency is how many times the data operations are
This article to you to share is a detailed example of the use of Python advanced functions, the content is very good, hoping to help the needy friends.
function Parameter Problem
Three basic conditions
Fun (A, B)
Fun (A, b) B is an
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