← Back to Strings
Question 43
Mask All But The First
Mask All But The First
Read one word and print it with every character except the first replaced by *, as in G****** for a seven-letter name. Start the result as the first character, loop over the slice [1:] of the word adding one star per character, then print the built string. Input: one line, the word, no prompt.
Expected Output:
G******= newline. The output ends with a newline — print one after the last line.
Hints3 available
Sign in to use hintsTopics:
Strings
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.