写一个方法判断一个字符串是不是对称的

def is_dui_chen(st):
st = str(st)
for i in range(len(st) // 2):
if st[i] == st[-1 - i]:
return True
else:
return False


print(is_dui_chen('3ab6ba3'))
posted @ 2018-10-29 17:33  laosun0204  阅读(1231)  评论(0编辑  收藏  举报