Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- l = raw_input("Enter String ")
- lint, lalph, lnew, c,d = [],[],[],0,0
- for i in l.split():
- if ord(i[0]) >96 and ord(i[0]) < 123:
- lalph.append(i)
- else:
- lint.append(int(i))
- lalph.sort()
- lint.sort()
- for i in l.split():
- if ord(i[0]) >96 and ord(i[0]) < 123:
- lnew.append(lalph[c])
- c+=1
- else:
- lnew.append(lint[d])
- d+=1
- print l
- print " ".join(map(str, (lnew)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement