String Methods
str.isprintable()
Determine whether the string is empty or consists of characters suitable for an unescaped built-in repr display under Python’s Unicode classification. Letters, marks, numbers, punctuation, symbols and ordinary ASCII space qualify; other separators and control/format characters do not. This is not a guarantee of visible rendering or safe terminal output. Takes no arguments.
Formal Syntax & Structure
python syntaxpython
text.isprintable()Return Value
bool
True when the stated classification holds; otherwise False.
Working Example
Example Snippetpython
for text in ("سلام", " ", "\n", "\u200c", ""): print(ascii(text), text.isprintable())