| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1652,8 +1652,14 @@ expression support in the :mod:`re` module). | |||
| 1652 | 1652 | ||
| 1653 | 1653 | Return centered in a string of length *width*. Padding is done using the | |
| 1654 | 1654 | specified *fillchar* (default is an ASCII space). The original string is | |
| 1655 | - returned if *width* is less than or equal to ``len(s)``. | ||
| 1656 | - | ||
| 1655 | + returned if *width* is less than or equal to ``len(s)``. For example:: | ||
| 1656 | + | ||
| 1657 | + >>> 'Python'.center(10) | ||
| 1658 | + ' Python ' | ||
| 1659 | + >>> 'Python'.center(10, '-') | ||
| 1660 | + '--Python--' | ||
| 1661 | + >>> 'Python'.center(4) | ||
| 1662 | + 'Python' | ||
| 1657 | 1663 | ||
| 1658 | 1664 | ||
| 1659 | 1665 | .. method:: str.count(sub[, start[, end]]) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments