String Methods
isprintable()
Check whether all characters can be printed, apart from the empty string which also passes.
str.isprintable()
Check whether all characters can be printed, apart from the empty string which also passes.
Returns
True if every character is printable or the string is empty; otherwise False.
Try it
Run it and change it
text = "Hello\n" print(text.isprintable())