Python String isprintable() Method

Returns True if the all characters in a string are printable. Examples of non-printable characters are carriage return, line feed, and tab.

Syntax

Python
string.isprintable()

Example

Python
print('Abc 123 Def !!!'.isprintable())
print('Abc 123\r\nDef !!!'.isprintable()) # CR LF is not printable
print('Abc 123\tDef !!!'.isprintable())   # Tabs are not considered printable!

Output

True
False
False