diff --git a/projects/006-run-length-decoding/python/main.py b/projects/006-run-length-decoding/python/main.py index e69de29..bb68ab1 100644 --- a/projects/006-run-length-decoding/python/main.py +++ b/projects/006-run-length-decoding/python/main.py @@ -0,0 +1,10 @@ +def run_length_decoding(undecoded_list): + + if not undecoded_list: + return undecoded_list + + else: + letter = undecoded_list[0] + number = undecoded_list[1] + + return [letter] * number + run_length_decoding(undecoded_list[2:len(undecoded_list)])