大厂笔试题
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.
 
 
 

35 lines
712 B

def outer(fun):
def wrapper(s):
# 获取字符串的前三个字符
first_three = s[1:4]
#倒序前三个字符
reversed_three = first_three[::-1]
# 返回拼接后的字符串
return first_three + reversed_three
return wrapper
@outer
def fun(s):
return s
str = input()
print(fun(str))
# def process_list(li):
# li[:] = li[:6]
# li.sort(reverse=True)
# l1 = li[1::2]
# l2 = li[0::2]
# l2.reverse()
# li[:]= l2 + l1
# return li
# # str="[2,1,6,4,5,3,7,8]"
# str=input()
# str=str[1:-1]
# after5 = str.split(',')
# res = process_list(after5)
# res2 = [int(i) for i in res]
# print(res2)