1, split (seq) str.split (seq) is a common character string processing method according to the partition string str seq. seq is not necessary, defaults separated by spaces, may be a single character seq, may also be a string. The contents of the divided return to the list of types.
. 1 n-INPUT = ( " Please enter the four digit (separated by spaces): " ) 2 A = n.split ()
2, pow (x, y) is built-in functions of one python, action is to return power of x y.
3, format () function
digital | format | Export | description |
---|---|---|---|
5 | {:0>2} | 05 | Digital zero padding (padding right left, width 2) |
5 | {:x<4} | 5xxx | Complement x (left and right padding, width of 4) |
10 | {:x^4} | x10x | Complement x (center filling, a width of 4) |
13 | {:10} | 13 | Align Right (width 10), a default alignment |
13 | {:<10} | 13 | Left (width 10) |
13 | {:^10} | 13 | Align middle (width 10) |