6. Local variables and global variablesA variable defined in a subroutine is called a local variable, and a variable defined at the beginning of the program is called a global variable.The global variable scope is the entire program, and the local
1. IntroductionWeak Type A variable can be assigned a value different from the original typex = 1x = "1" #不加分号, it is possible to assign a value of x to a string againWith or not, and or not/#除法的结果是浮点数, 9/3 = 3.0#结果是整数 10//3 = 3Null value is none
Closures: is a reference to a non-global variable of the outer layer function (non-global variable) of the inner layer functiondef func (): ' elderly ' def func1 (): Print (name) # local variable reference to global variable because
The so-called RE, is regular Expressions. The regular expression. Matches and returns a string according to the specified rule.The matching rules (reproduced) are described in detail below.1.
.
Matches any character other than "\
Iteration:An iteration is a repeating process that repeats one iteration at a time, and the result of each iteration is the initial value of the next iterationWhy you have iterators:The values of data types, strings, lists, tuples depend on the
1, Case flip>>> str='hello,ghostwu'>>> str.swapcase ()' HELLO,GHOSTWU'2, extracting a combination of pure numbers from a string of strings>>> str="adfask22jkljhh3jkljhgh435""inif S.isdigit ()])'223435'Equivalent to:>>> str="adfask22jkljhh3jkljhgh43
Some of the pictures and ideas in this article are all references to the ideas of https://www.cnblogs.com/My-code-z/p/5712524.html and their own personal understanding.The principle of thinning algorithm is not difficult to understand, the use of
int (integral type)The number of integers is 32 bits and the value range is -2**31~2**31-1, which is -2147483648~2147483648Long (integer)Unlike the C language, Python's long integers do not refer to the positioning width, i.e. python length does not
1. Download and install Python2. Verify that the Python installation is successful or not3. Selenium installation via PipIn the command line that you just opened, enter: Pip install SeleniumThis will install the latest version of selenium by default,
1. Get the embarrassing Wikipedia URLHttp://www.qiushibaike.com/hot/page/2/End 2 refers to page 2nd2. Analysis page, find the location of the section, need a bit of CSS and HTML knowledge3. Write code1 Importurllib.request2
Why should I use a function? Because if there are no functions, our usual code will have a lot of repetition.Avoid code reuseImprove the readability of your codesecond, the definition and invocation of functions: 1. def function name (parameter 1,
List : A collection of data, which can be placed in any data type, can be used for the operation of additional deletions and checksThere is a sequence table function (index is the indexed value of the list):① Create: Use [] to add elements, such as
One: Use of the RE moduleIn Python, when you need to match a string with a regular expression, you can use a module reRe module use process:Import re #导入re模块result = Re.match (regular expression, string to match) #使用match () method to match, or none
Narcissus numbers (narcissistic number) are also known as ultra-complete numeric invariants (pluperfect digital invariant, ppdi), narcissism, self-power, Armstrong or Armstrong numbers (Armstrong number), Narcissus number refers to an n-bit number
python3.x implement print No Line breakPython is followed by the default newline after print because its default property, the default value, is "\ n"(\ n is a newline character).Do exercise 99 when you do not want to break the multiplication table,
JSON is a commonly used data exchange structure, which is widely used in network because of its characteristics of lightness, easy reading and writing. The following article mainly describes the Python JSON parsing related data, the need for friends
This article is to share the details of Python's standard input and output, the content is very good, I hope to help the needy friends
I. Standard input and OUTPUT
1. Print to screen
The simplest way to produce output is to use the print statement,
This article is mainly to share with you about the example of how Python can easily implement dynamic progress bar, the need for small partners to see
Ideas and explanations
Suppose there is a list of 1000000 data (so that the progress bar can be
02-Python download and installation _ Python programming path, 02-python_python
The original Article is published on the TOPEX blog www.susmote.com.
I have told you about the background of python and the advantages and disadvantages of Python. I
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