摘要:
知识点: 逆序遍历range:只需要[::-1]即可 (从头到尾切片,步长设置为-1) 代码 s=input() a,b=input().split() for i in range(len(s))[::-1]: if s[i]==a or s[i]==b: print("{} {}".format 阅读全文
摘要:
方法一:使用list judge = [] for i in range(26): judge.append( chr(65+25-i) ) # print(judge) n= input() n= [judge[ord(i)-65] if 'A'<=i<='Z' else i for i in n 阅读全文