how to seperate words and number in a list
ip=['a',1,2,3]
m=[]
n=[]
for x in range(0,len(ip):
if str(ip[x]).isdigit():
m.append(ip[x])
else:n.append(ip[x])
print(m,n)
how to seperate words and number in a list
ip=['a',1,2,3]
m=[]
n=[]
for x in range(0,len(ip):
if str(ip[x]).isdigit():
m.append(ip[x])
else:n.append(ip[x])
print(m,n)
extract numbers from list of strings python using regex
new_list = [int(item) for sublist in a for item in sublist if item.isdigit()]
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us