- The common methods of STR are:
Str.digits0-9 's expression
Str.uppercase Capital Letters
Str.lowercase Small Letter
Str.letters All Letters
"". Join (STR) "" must have a value in order to use the join
Str.encode ()
Str.replace (x, y) to replace Xs in str with y
The value in Str.split () split must be contained in STR, otherwise the effect of splitting is not
Str.zfill (x), x is the int type and if the string is less than x-bit long, it is filled with 0 in front
List.append ()
List.insert (x, y)
Del List[index]
Pop list
"". Join (list)
List.index (value) Enter a value in list to see its subscript
List.count (value) calculates the number of occurrences of value in the list
Dict[key]=value
Del Dict[key]
Dict.items () return list [(Key,value),...]
Dict.keys () return list [Key1,key2 ...]
Dict.has_key () True or False
Dict.values () return list [value1,value2 ...]
Dict.update ()
Dict.clearclear All
- Common methods for tuple:
Tuple.count () calculates the number of occurrences of a value in a primitive
Tuple.index () returns the position of the first occurrence of a value in the ancestor
Python Test Development---list, str, dict, tuple summary