如何将字符串中的数字跟字母分开
作者:互联网
import sys
# coding=utf-8
stringg='11AABBCCbc22defghijklm'
sz=[]
zm=[]
for i in stringg:
i=i.lower() #1122aabbcdefghijklm
if i in "abcdefgfhijklmopq": #abcdefgfhijklm
zm.append(i)
if i in '0123456789':
sz.append(i)
print(sz) #1122
print(zm) #abcdefgfhijklm
标签:sz,zm,字母,0123456789,coding,分开,字符串,abcdefgfhijklm,append 来源: https://www.cnblogs.com/lllwy/p/16140468.html