Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def decorator(str1):
- strlen = len(str1)
- mid = len(str1)//2
- for i in range(mid):
- print((" "*i)+f"{str1[i]}"+(" "*len(str1[i+1:strlen-1-i]))+f"{str1[strlen-1-i]}")
- if strlen%2 != 0:
- print((" "*(i+1))+str1[mid])
- decorator("python")
- '''
- Output:-
- p n
- y o
- th
- '''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement