_age = 27Count = 0While Count Age = Input ("What's The Age?")if age = = _age:Print "Ni cai de {yourage} is sussccess". Format (Yourage=age)BreakElif Age Print "Ni cai de {yourage} nianlin Xiao Yu age". Format (Yourage=age)ElsePrint "Ni cai de
In the process of running the program, if an error occurs, you can agree to return an error code beforehand, so that you can know if there is a mistake, and the cause of the error.Try...except...finally ...Try: Print('Try ...') R= 10/int ('2')
The string type consists of multiple characters that can be used as a whole, or any part of a string.function Len () returns the length of the string' www.baidu.com '>>> len (address)13View CodeTo traverse a string with a for statementStarting with
Recently learning Python, the job is to write a reader in Python:Requirements are as follows:1, with automatic reading mode2, you can page up and downActual combat:The code is as follows:650) this.width=650; "title=" Reader "src="
1, def __add__ (self,other): C1+C2 Two instances of the addition operation is the execution of __add__ () Method 2, __str__ (self):p rint An instance, the implementation of __STR__ () this built-in method Eg:class Vector (object): def __init__
SYS.ARGV command line argument list, the first element is the path of the program itselfSys.exit (n) exit program, Exit normally (0)Sys.version get version information for Python interpreterSys.maxint the largest int valueSys.path returns the search
Idle editor shortcut keysAuto-complete code alt+/(find the code already written in the editor to complete)Completion hint Ctrl+shift+space (default and IME conflict, modify)(Method: Options->configure idle...->keys-> force-open-completionsPrompt
One, character encoding and transcodingFirst, Python2.
The default encoding in PY2 is ASCII
The code declaration at the beginning of the file is to tell the program that explains it to read the code into memory, because in memory, this
Function-Type programming1. Simplify the code,2, easy to call, easy to modify3. Call parameters, shape parameters, and positional parameters. Key parameters, position parameters can only be sent after the key parameters4. Default parameters5.
I used to write Python code using notepad++, and then I remembered that there was a vs code that could write some scripting language (js,node.js) or even a high-level programming language (C#,php,java,python, etc.) before I looked up the data. And
Stability and significance of sorting algorithm
Bubble sort
Complexity and stability
Select sort
Insert Sort
Hill sort
Quick Sort
Comparison of efficiency of common sorting algorithms
Stability and significance of
Python's regular is supported by the RE module
3 Matching functions
Match: Matches only from the beginning of the string to the regular expression, the match returns Matchobject successfully, otherwise none is returned;
Re.match (Pattern, String,
A class is an abstract concept that describes the definition of a thing.
An instance refers to a specific individual of that kind of thing, something that is specific
To make an analogy:"Man" is a class. "Zhang San" is a concrete example of human
Notes for common Jupyter shortcuts and methods, and notes for jupyter shortcuts
Two different cells have an upper-lower relationship, which is not completely independent. We can see that the following res references the above
Shortcut
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