Advertisement
Programmin-in-Python

Magical String Operation

Jan 20th, 2021
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.14 KB | None | 0 0
  1. num = input("Enter the Word : ")
  2.  
  3. end = num[-1:-3:-1]
  4.  
  5. star = "*" * len(num[2:len(num)-2])
  6.  
  7. res = num[:2] + star + end[::-1]
  8.  
  9. print(res)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement