Python built-in type continuation
Python does not allow you to use a variable that is not assigned a value. This will cause an exception.
Python assignment:
Assign multiple values at a time: Use the constant value of Tuple to assign Tuple to variable values of the same number.
You can use the Print function. _ doc _ to view most documents in Python. That is, every object in basic Python has an attribute such as _ doc.
Format String:
Python supports formatted string output.
The most basic usage is to insert a value into a string with the string format character % s (note that s is a lower-case Python case sensitive.
>>> K = "Uid"
>>> V = "SA"
>>> "% S = % s" % (K, V) Note that (K, V) is a Tuple
'Uid = Sa'
Only the Tuple of an element: Tup = (A,) must have A comma before the parentheses, so that Python can identify this as A Tuple ..
The % f format character option corresponds to a decimal floating point number, which can specify the decimal precision.
%. 2f indicates that only two decimal places are printed.
Ing List
One of the powerful features of Python is its List parsing. It provides a compact method that maps a List to another by applying a function to each element in the List.
Parse the List without changing the original List.
The Join function can link any List containing strings to a single string! String Join method!
The Join function can only be used for the List where the element is a string! It does not perform any forced type conversion.
The split method can split the string into a List.
Split can have a second parameter, indicating the number of splits!
Tip: search by split
Anythin. split (delimiter, 1) is a useful technique. You can search for a substring and then separate the first and last parts of the string.
June