大厂笔试题
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
712 B

2 weeks ago
  1. def outer(fun):
  2. def wrapper(s):
  3. # 获取字符串的前三个字符
  4. first_three = s[1:4]
  5. #倒序前三个字符
  6. reversed_three = first_three[::-1]
  7. # 返回拼接后的字符串
  8. return first_three + reversed_three
  9. return wrapper
  10. @outer
  11. def fun(s):
  12. return s
  13. str = input()
  14. print(fun(str))
  15. # def process_list(li):
  16. # li[:] = li[:6]
  17. # li.sort(reverse=True)
  18. # l1 = li[1::2]
  19. # l2 = li[0::2]
  20. # l2.reverse()
  21. # li[:]= l2 + l1
  22. # return li
  23. # # str="[2,1,6,4,5,3,7,8]"
  24. # str=input()
  25. # str=str[1:-1]
  26. # after5 = str.split(',')
  27. # res = process_list(after5)
  28. # res2 = [int(i) for i in res]
  29. # print(res2)