题解 | #字符串加解密#
字符串加解密
https://www.nowcoder.com/practice/2aa32b378a024755a3f251e75cbf233a
def check(str,f): l1 = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' l2 ='BCDEFGHIJKLMNOPQRSTUVWXYZAbcdefghijklmnopqrstuvwxyza1234567890' res = '' for i in str: if f == 1: res += l2[l1.index(i)] elif f == -1: res += l1[l2.index(i)] return res print(check(input(),1)) print(check(input(),-1))