newton/solutions/python/474A.py

24 lines
375 B
Python
Raw Normal View History

2025-02-07 22:36:30 +00:00
shift = input()
s = input()
rows = [
"qwertyuiop",
"asdfghjkl;",
"zxcvbnm,./",
]
construct = ""
for i in range(len(s)):
for j in rows:
row = list(j)
if s[i] in row:
if shift == "R":
change = -1
else:
change = +1
construct += row[row.index(s[i])+change]
print(construct)