Loading...
Loading...
Loading...
A statement shows only the last 4 digits of an account number. Every earlier digit is replaced by *.
Read the account number and print the masked version. A number with 4 or fewer digits is printed as it is.
Example
Input
9876543210
Output
******3210
Six stars, then 3210.
Try the problem first. Open one hint at a time.
The visible part is the last 4 characters; the hidden part has len - 4 characters.
Repeat "*" that many times and add the slice account[-4:].
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor