import string #make translator object translator=str.maketrans('','',string.punctuation) string_name=string_name.translate(translator)