PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
'''
CHALLENGE : ORDERING THE STRING!
https://www.sololearn.com/Discuss/1064540/
You are given a string, you have to arrange its each character in the following order:
👉In case of capital and small letter occurrence, capital letters will be ordered first and then small letters. If any letter repeats, replace the repeated part with number of its occurrences
👉Then numbers in ascending order (in parenthesis)
👉And at last the other characters in sequence of string
Example,
Input = I-Love2-Code-Since*1951
Output = CILScde3ino2v(1259)-*
📌Comment a link of this CHALLENGE in your post!
'''
from string import ascii_uppercase as upper
from string import ascii_lowercase as lower
from string import digits
# t for text
t = "I-Love2-Code-Since*1951"
# Otherwise, try your own input:
#t = input()
# o for output
o = ""
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run