Run Length Encoding Python Code