← Back to challenges

Modify Words

PythonHardarraysformattingloopssortingstrings

Instructions

Create a function that takes a list of any length. Modify each element (capitalize, reverse, hyphenate).

Examples

edit_words(["new york city"]) ➞ ["YTIC KR-OY WEN"]

edit_words(["null", "undefined"]) ➞ ["LL-UN", "DENIF-EDNU"]

edit_words(["hello", "", "world"]) ➞ ["OLL-EH", "-", "DLR-OW"]

edit_words([""]) ➞ ["-"]

Notes

Input list values can be any type.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.