輸入任意一個字符串,判斷這個字符串是不是迴文,迴文示例: 上海自來水來自海上

2.輸入任意一個字符串,判斷這個字符串是不是迴文 迴文示例: 上海自來水來自海上 ABCCBA 12321 迴文是指中心對稱的文字 #方法1 str = input('請輸入一個字符串:') count = 0 lenth = len(str) print('lenth', lenth) for i in range(lenth // 2): if str[i] == str[lenth
相關文章
相關標籤/搜索