Output will appear here...
Write a function all_prefixes(s) that returns a list of all prefixes of the string s, ordered from shortest to longest. The whole string counts as its own longest prefix.
For example, all_prefixes("abc") returns ["a", "ab", "abc"].
The starter code reads a non-empty string and prints the prefixes separated by spaces.
No comments yet. Start the discussion.