Re: Problem with rearanging list with paired letters next to each others

2020-11-11 Thread dn via Python-list
On 12/11/2020 00:45, Bischoop wrote: I see now I overcomplicated it, what is a good idea then? This is a variation on a data-compression technique called RLE=Run-Length Encoding (excepting that in this case there is no need to count the repetitions). Web.Ref: https://stackabuse.com/run-len

Re: Problem with rearanging list with paired letters next to each others

2020-11-11 Thread Bischoop
On 2020-11-11, MRAB wrote: >> > Points to note in your first code: > > 1. Modifying a list while iterating over it is a bad idea. > > 2. You're modifying the list that you're passing in and also returning > it. That's a bad idea. Either modify it in place or modify and return a > copy. > > 3. T

Re: Problem with rearanging list with paired letters next to each others

2020-11-10 Thread MRAB
On 2020-11-11 01:26, Bischoop wrote: Can anybody help?Here's the code that gives me a hedeache for second day https://bpa.st/XLOA If I have letter_list = ["a","a",,"b","b","c","c"] it's working correctly but if I have three or more of any letters for example:letter_list = ["a","a","a","b","b","

Problem with rearanging list with paired letters next to each others

2020-11-10 Thread Bischoop
Can anybody help?Here's the code that gives me a hedeache for second day https://bpa.st/XLOA If I have letter_list = ["a","a",,"b","b","c","c"] it's working correctly but if I have three or more of any letters for example:letter_list = ["a","a","a","b","b","c","c"], I'm ending up with some pair