记录自己的python之路
for循环
a = 'sljf3124affa5f'
for i in range(0,len(a)):
for c in range(10):
if a[i] == str(c):
print(a[i]) #通过for循环提取
正则表达式
import re
a = 'sljf3124affa5f'
b = re.findall('\d',a) #\d是元字符
记录自己的python之路
for循环
a = 'sljf3124affa5f'
for i in range(0,len(a)):
for c in range(10):
if a[i] == str(c):
print(a[i]) #通过for循环提取
正则表达式
import re
a = 'sljf3124affa5f'
b = re.findall('\d',a) #\d是元字符