Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open("in.txt", 'r') as inf:
- s = inf.readline().strip()
- result = ''
- count = 0
- while count < len(s):
- lin_c = s[count]
- lin_n = s[1 + count]
- for j in range(2 + count, len(s)):
- if s[j] < 'A':
- lin_n += s[j]
- else:
- result += lin_c * int(lin_n)
- count += len(lin_c) + len(lin_n)
- break
- with open("out.txt", 'w+') as ouf:
- ouf.write(str(result))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement