要想检查文本是否属于回文需要忽略其中的标点、空格与大小写。例如,“Risetovote,sir.”。#coding=utf-8importstringFunction:tocheckwhetherthestringispalindromeornot.Ignorespace(空格),case(大小写)andpunctuation(标点符号).defreverse(text):returntext[:
python备份 zip压缩归档 按日期归档
51CTO博客开发
Copyright © 2005-2025 51CTO.COM 版权所有 京ICP证060544号