Delete all characters from s that are in deletechars (if present), and then translate the characters using table, which must be a 256-character string giving the translation for each character value, indexed by its ordinal. If table is None, then only the character deletion step is performed.
您应该转义撇号
'
或使用引号"
来定义字符串:或者
要删除符号
'
和空格,请按如下方式使用string.translate
:相关问题 更多 >
编程相关推荐