-
Write a program that reads a single line of input and prints the first
two and last two characters of the given input and prints the asterisk
character (*) in place of the remaining characters.
Answers
Answered by
0
Answer:
Step-by-step explanation:
For example, if the given string is
message, then the first two and last two characters are me, ge. Now replacing all the remaining
s = input()
if len(s) > 4:
k = len(s) - 4
s = s[:2] + '*'*k + s[len(s)-2:]
Similar questions
Physics,
2 days ago
Math,
2 days ago
Math,
8 months ago
Math,
8 months ago
Computer Science,
8 months ago