Regroup 3 X82905


Statement
 

pdf   zip

html

Write a function regroup that receives as argument a string consisting of lower-case letters and digits, and returns a regrouping of the characters in the string. The regrouping is as follows: in the returned string, first there come the letters, in the same order as they came in the argument string; and next come the digits, in the same order as they came in the argument string.

Sample session
>>> regroup('r2b2')
'rb22'
>>> regroup('a45tr09pw')
'atrpw4509'
>>> regroup('nonumbers')
'nonumbers'
>>> regroup('543210')
'543210'
Information
Author
ProAl
Language
English
Official solutions
Python
User solutions
Python