对称字符串
题目说明
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('不存在对称字符串')
评分标准
-
rst += i 或 rst= rst +i(2分) -
nxzf(data[1:])+data[0](3分) -
nxzfc == yw(3分)
本题为编程题,提交代码并运行通过测试点后判分。
正在加载题目数据…
子题
该题型需在试卷/作业中作答,单题练习暂不支持
答案解析