Skip to the workspace
Pebellslearn by building
← All practice tasks

Foundation · Coding exercise

Mask a reference number

strings · boundaries

Not checked yet

Guest practice stays in this visit. Sign in to save your progress. Checks cover the stated cases; discussion rubrics are self-reviewed. These tasks do not mark course lessons complete.

DrillMask a reference number

Implement mask(text, keep=4). Preserve the final keep characters and replace earlier characters with *. For keep <= 0, mask every character. If keep exceeds the length, preserve the whole text. Inputs are strings and integers.

Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.