1 s = input("输入:") 2 result = '' 3 for i in range(len(s)): 4 result += chr(ord(s[i])^2000) 5 print(result)
ord(char) #把字符转换成unicode编码(整型)
chr(unicode) #把unicode转换成字符
1 s = input("输入:") 2 result = '' 3 for i in range(len(s)): 4 result += chr(ord(s[i])^2000) 5 print(result)
ord(char) #把字符转换成unicode编码(整型)
chr(unicode) #把unicode转换成字符
转载于:https://www.cnblogs.com/-nbloser/p/7990228.html