SyntaxFix
Write A Post
Hire A Developer
Questions
This function uses list comprehensions and str.join, so it runs in linear time instead of O(n^2):
from curses.ascii import isprint def printable(input): return ''.join(char for char in input if isprint(char))