对称字符串
类型:程序题

题目说明

def getzf(yw):   #筛选出原始字符串yw中大写小写字符组成的字符串
    rst = ''
    for i in yw:
        if 'z'>=i >='a' or 'Z'>=i >='A':
            ①
    return rst
def nxzf(data):  #生成字符串data的逆序字符串
    if len(data) == 1:
        return data[0]
    return         ②
yw =input('请输入字符串')
yw = getzf(yw)
nxzfc = nxzf(yw)
if         ③        :
    print('原字符串中存在对称字符串',yw)
else:
    print('不存在对称字符串')

评分标准

  1. rst += i 或 rst= rst +i(2分)

  2. nxzf(data[1:])+data[0](3分)

  3. nxzfc == yw(3分)

代码编辑器 加载中...
留空使用题目默认限制
{{resultStatus.text}}
正在加载运行记录...
乐编题库AI助手
人工客服
微信扫码联系客服
历史对话
{{ s.title || '未命名对话' }}
{{ s.created_at }}
暂无历史对话
我能帮助你什么?