I have tried and google the solution for below mentioned code but unfortunately I didn't get anything regarding this.
Don't change the logic pleaseConvert it into list comprehension. I Have tried list comprehension. I'm bit far from getting output.But due to syntactical error, I'm getting failure. Thanks in advance.
data = "abc@#123"
t=tuple(data)
flag=0
print(t)
alpha=[]
digit=[]
spl_chr=[]
for i in t:
if i.isnumeric():
i=int(i)
if type(i)==type(flag):
digit.append(i)
elif type(i)==type(data) and i.isalpha():
alpha.append(i)
else:
spl_chr.append(i)
dic={}
dic["alphabets"]=alpha
dic["digits"]=digit
dic["symbols"]=spl_chr
print(dic)