title: RLE ALgorithm in python
body: <p>like the title suggest I want to do an RLE algorithm and I have few problems with that</p>
  <p>for example in RLE algorithm if we take aaaabbbccd it should return a4b3c2d1 as a result</p>
  <p>the rle function should return the compressed string of aaabbbccccddddd</p>
  <p>rle(data : str) : str</p>
  <p>so it would be a3b3c4d5</p>
  <p>Here's the code I know it's wrong but I don't know If it was a good way to begin</p>
  <pre><code>def rle(data):
              
      data = 'aaabbbccccddddd'    
      for i in range(0,len(data)):
                                    
          if data.count(f'{i}') &gt; 1:
             
             data.replace(i, data.count(f'{i}'))
             print(data)
  
  print(rle(data))
  </code></pre>