Advertisement
Guest User

Untitled

a guest
Dec 10th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. decoded = []
  2. lines = int(input('please enter the amount of lines of RLE compressed data'))
  3. while lines <2:
  4. print('enter a value above two')
  5. lines = int(input('please enter the amount of lines of RLE compressed data'))
  6. for i in range (lines):
  7. encoded = input('Enter compressed data: ')
  8. index = 0
  9. index2 = 2
  10. string = ''
  11. for i in range (0,len(encoded)//3):
  12. num = int(encoded[index:index2])
  13. char = encoded[index2]
  14. a = (num*char)
  15. string += a
  16. index += 3
  17. index2 += 3
  18. decoded.append(string)
  19. for i in range (len(decoded)):
  20. print(decoded[i])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement