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) ...
1 s = input("輸入:") 2 result = '' 3 for i in range(len(s)): 4 result += chr(ord(s[i])^2000) 5 print(result)View Code
ord(char) #把字元轉換成unicode編碼(整型)
chr(unicode) #把unicode轉換成字元