Skip to main content
2 of 3
added 337 characters in body; added 6 characters in body
gnibbler
  • 15.3k
  • 4
  • 51
  • 76

Python

from itertools import groupby s=`len(' ')` for x in' ': print s s=''.join(i+`len(list(j))` for i,j in groupby(s)) 

and a version without the hacky strings

from math import * from itertools import groupby s=`int(log(e))` for x in s*int(e**pi-e): print s s=''.join(i+`len(list(j))` for i,j in groupby(s)) 

note that e**pi-pi is very close to 20 (19.99909997918947) but slightly smaller, so it's no good to use int with

gnibbler
  • 15.3k
  • 4
  • 51
  • 76