This section focuses on data types in the basics of Python, numbers and Boolean valuesIntroduce several points of knowledge:1) The use of the built-in function print (), print the contents of the parentheses directly, or print followed by multiple
Creating a Self object is a very central concept of python, in fact, Python is called an object-oriented language, and this chapter describes how to create objects. and object-oriented concepts: inheritance, encapsulation, polymorphism.
Variable
id=10 #数值
Config= "/data/saltstack" #字符串
List
list = [' A ', ' B ' ...] #定义列表用 [], you can define an empty list, and then dynamically append elements.
List[0] #引用列表元素用下标, 1 represents the end
Python exceptionPython uses exception objects (exception object) to represent exception conditions. An exception is thrown when an error is encountered. If the exception object is not handled or captured, the program terminates execution with the so-
I. JMeter pressure measurementTwo. Setting up the scene1. Single-scene and multi-scene, mixed scene is the time to test a single interface, multi-scenario is the case of business processes, such as a shopping process, then this scene is a mixed
Sequence OverviewPython contains 6 built-in sequences that focus on two of the most common types: lists and tuples.The main difference between a list and a tuple is that the list can be modified and tuples cannot. This means that if you want to add
1. InputRead the console input, the output is a string2, EnumerateWhen iterating through an array, the index and item can be returned at the same time, and each item returned contains Index,item3, Isinstance (Object,class)When you determine that the
Meta-groupWhat is a tuple: "Tuples are an immutable list" (not lists, just for ease of memory)Purpose: Used for storing multiple values, can only be read and cannot be assigned two timesRepresentation: parentheses () divide the elements with commas
The meaning of installing two versions
Verifying your code's compatibility with versions
Some of the source code downloaded online can only be run in Python2 or Python3.
installation process logging 1. Go to Python's website to
When writing a use case, you often call other functions, some of which need to be passed in, some of which are not needed. So what are the types of functions, and look at:No parameter, no return valueNo parameters, with return valuesWith parameters,
get the experience quickly and then seek theoretical support first.Small white based on the existing experience, the software requirements of PYCDC have been further improved.The Code of previous verification ideas becomes a handy feature that can
Just using Python's readline (s) to read the discovery of the file will always appear in the format of some small errors, and then think of it because the file newline characters and other symbols (\n\r\t) will also be readline (s) to read, the
Error description
Typeerror:list indices must be integers or slices, not str
Cause of error
When you take a tag attribute,find_all()find()errors caused by differences in function and functionDetailed
Find_all ()No matter how many are
1. A variable is an area of computer memory where a variable can store values within a specified range, and the value can be changed.Constants are a read-only area of memory that cannot be changed once they are initialized.In general, the simplest
@ (python path) [object-oriented, Singleton mode][TOC]Simple Interest ModeSingleton mode: is a common software design pattern, the main purpose of this mode is to ensure that only one instance of a class exists. a singleton can come in handy when
Hi-nginx-1.3.4 compilation installation, hi-nginx-1.3.4 Compilation
Hi-nginx is both a web server and an application server. It is open source in https://github.com/webcpp/hi-nginx
It is a superset of NGINX, so it is slightly different from
Python3 replace () function usage, python3replace
DescriptionThe replace () method replaces the old (old string) in the string with new (new String). If the third parameter max is specified, the replacement cannot exceed max.
SyntaxReplace () method
Full-stack python development-Day5 tuples, dictionaries, python-day5Full-stack python development-Day5 tuples and dictionariesI. PrefaceFirst of all, no matter what data type we learn, we will start learning with the following questions:#1: basic
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