Python String isprintable() MethodPython isprintable() method returns True if all characters in the string are printable or the string is empty. It returns False if any character in the string is Nonprintable. SignatureParametersNo parameter is required. ReturnIt returns either True or False. Let's see some examples of isprintable() method to understand it's functionalities. Python String isprintable() Method Example 1It is a simple example that prints True, if the string is printable. See the example below. Output: True Python String isprintable() Method Example 2Here, we are using some other characters like newline and tabs in the string. See the results of the example. Output: True False False Python String isprintable() Method Example 3Testing different-different string values which contains special chars too. In case of special chars, method returns False. Output: It is printable It is printable Not printable Next TopicPython Strings |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India