输入"noon" 输出"noon"
输入"noo" 输出"noon"
输入“sakura" 输出"arukas"
def cal(num1):
def judge(num):
for i in range(0,len(num)):
# print(num[0])
# print(num[-(i+1)])
if num[i] != num[-(i+1)]:
return False
return True
a = judge(num1)
if a:
return True
reverse_list = ""
for sb in range(len(num1)-1,-1,-1):
reverse_list +=num1[sb]
# print(reverse_list)
for m in range(len(reverse_list)-1,-1,-1):
num3 = num1
num3+=reverse_list[m::]
if judge(num3):
print(num3)
return True
cal("我妈一天只晓得看熊猫")
网友评论