Python处理字符串中的数字

1、

from string import digits
aa = '1043数学'
res = aa..translate(str.maketrans('','',digits))
print(res)

 2、slice()

posted @ 2020-08-04 14:29  cola_cola  阅读(380)  评论(0编辑  收藏  举报