返回列表 發帖
str1="QAZWSXEDCRFVTGBYHNUJMIKOLP"
str2="WSXEDCRFVTGBYHNUJMIKMOLPLP"

str3=input()
for i in range(len(str3)):
    if(str3[i].isupper()):
        
        idx=str1.find(str3[i])
        print(str2[idx],end="")
    else:
        s=chr(ord(str3[i])-32)
        idx=str1.find(s)
        
        s=chr(ord(str2[idx])+32)
        print(s,end="")

TOP

返回列表