Guest User

Untitled

a guest
Jan 2nd, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. '''
  2.  
  3. Write a program that reads a string from the file that matches the text compressed
  4. using repetition coding and performs the inverse operation to get the source text.
  5.  
  6. Write the received text to a file and attach it as an answer to this task.
  7.  
  8. There are no numbers in the source text, so the code is uniquely interpretable.
  9.  
  10. Note. This is the first task of the type Dataset Quiz. In such tasks,
  11. after clicking "Start Quiz" you have the link "download your dataset".
  12. Use this link to download the file with the input data to your computer.
  13. Run your program using this file as input.
  14. The output file that you can do with this should be sent as an answer to this task.
  15.  
  16. Sample Input:
  17. a3b4c2e10b1
  18.  
  19. Sample Output:
  20. aaabbbbcceeeeeeeeeeb
  21.  
  22. '''
  23.  
  24. a = input()
  25. b = []
  26. for i in range(len(a)):
  27. if a[i].lower() in 'qwertyuiopasdfghjklzxcvbnm':
  28. b+=a[i]
  29. a=a[:i]+"!"+a[i+1:]
  30. c=a.split('!')[1:]
  31. for i in range(len(b)):
  32. print(b[i]*int(c[i]), end="")
Add Comment
Please, Sign In to add comment