input: Write a function to return a list containing all prefixes of the given string starting from the shortest to the longest.
  assert collect_prefixes('') == []
  assert collect_prefixes('asdfgh') == ['a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh']
  assert collect_prefixes('WWW') == ['W', 'WW', 'WWW']
output: def collect_prefixes(s):
      return [s[:i] for i in range(1, len(s) + 1)]