You can implement above in dictionary,
a="000a1111a2222a3333a4444a"
b={}
for x in a:
    if b.has_key(x):
        t=str(b[x])
        t=t+x
        b[x]=t
    else:
        b[x]=str(x)
print b
for x in b:
    if 48 <= ord(x) <=57:
        print b[x]

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to