One, int type
Bit_length () returns a binary length of a number
II. type of bool
A Boolean has only two values. True,false. Generally there is nothing to do with it.
All empty is false, so the non-null is True
Iii. Types of str
The contents of the ",", "", "" are the strings.
A string is an immutable data type. No matter what you do. The source string will not change, and each operation will return a new string
1. Indexes and slices
Index starting at 0, using [subscript] to get to each character, you can also count backwards
Slice: [Start position: End Position: Step]
1. Gu Tou regardless of the tail
2. Default left-to-right values
3. When the step is negative, you can take the value from right to left
2. String-related operations
1. Upper () converted to uppercase
2. Stript () Remove blank
3. Replace (old, new) with XXX to XXXX
4. Split () cut. Returns the list. With how long the knife. How much will it cost?
5. StartsWith () Decide whether to start with XXX
6. Find (), count (), index ()
7. Len () string length. Python's built-in functions
3. For loop
The for variable in can iterate over the object:
Loop body, there are also break and continue
Else
When the loop ends, it executes.
Some common methods of type int, bool type complement, and string in Python