1. Class ():
Automatically call internal method __init__ ()
int (), str (), list (), bool (), tuple (), Dict (), object-oriented class.
2. Int:
A. Method of Creation (two):
1). A = 123
2). A = in (123)
__init__ (self, x, base=10): x: Number. Base: The default is 10 binary.
B. Additions:
python internal optimization: A duplicate default memory address within the range ( -5< contains > ~257< does not include >)
View memory address: ID (variable name)
view string, array length:len (string, array)
C. Length limitation:
int type:
32-bit system: integer with 32 bits, value range: -2**31~2**31-1 ( -2147483648~2147483647)
64-bit system: integer with 64 bits, value range: -2**63~2**63-1 ( -9223372036854775808~9223372036854775807)
Automatically converted to a long type after it is exceeded.
Long type:
No length limit, determined by memory size.
bytes
3. STR:
A. String creation (two ways):
S1 = "Alex"
S1 = str ("Alex")
__init___ (Self, value= ", Encoding=none, errors= ' strict '): Value: The content parameter of the string. Encoding: Encoding defaults to none. Errors: The default is strict mode (strict), which is not changed by default.
No arguments: Creates an empty string.
1 Parameters: Create a normal string
2 parameters: Int (bytes, encoded)
B. Specific methods:
Strip (): Go to both ends of the space.
Lstrip (): left blank.
Rstrip (): Go to the right space.
StartsWith (): Start with XXX.
EndsWith (): End With XXX.
Find (): Finds a subsequence (can be one character or more than one character).
Replace (): Replaces a subsequence in a string with the specified value.
Upper (): variable capitalization.
Lower (): lowercase.
Isalnum (): Whether it is a letter or a number.
Isalpha (): Whether it is a letter or not.
IsDigit (): Determines whether it is a number.
Islower (): Determines whether it is lowercase.
Isspace (): Determines whether it is a space.
Istitle (): Determines whether it is a title.
Isupper (): Determines whether it is uppercase.
C. Public methods:
Index: [0],[1] ... Only one element can be taken
Slice: [0:1],[0:2] ... Multiple elements are preferable
Coding:
Len ():
For
Python Basics (9): Supplemental