Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- def process_decode(data):
- # print(re.split(r'(\D)',data))
- temp = re.split( r'(\D)', data )
- result = ''
- x = 1 # start from index 1
- while x < len( temp ) - 1:
- time = int( temp[x + 1] )
- # y from 0 to time = do temp[x] times.
- for y in range( time ):
- result += temp[x]
- x = x + 2
- return result
- size = (int)( input( "How many input data?? :" ) )
- n = 0
- while n < size:
- data = str( input( "decoded string: " ) )
- print('Case ' + str( n + 1 ) + ': ' + process_decode( data ))
- n = n + 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement