ID EN
Built-in Types

center

Python 3.11

Return centered in a string of length width. Padding is done using the specified fillchar (default is an ASCII space). The original string is returned if width is less than or equal to len(s).

Syntax

PYTHON
str.center(width[, fillchar])