finish extra/i-love-lance-janice #26

Merged
seongbeom_park merged 2 commits from extra/i-love-lance-janice into main 2022-05-10 14:10:54 +00:00
2 changed files with 20 additions and 0 deletions
Showing only changes of commit 8124382a8f - Show all commits

View File

@ -108,3 +108,6 @@ CFcSBwgCCBoHRhkKU1cGAA4AGU5YQR5THBwNFwoGGAxTQQMQVBUSBg4EAAwQRhUQVBUHFAQTGRpT QQM
### skipping-work
* Completed in: 20 mins, 58 secs.
### i-love-lance-janice
* Completed in: 34 mins, 26 secs.

View File

@ -0,0 +1,17 @@
def solution(x):
result = ""
for c in x:
if ord('a') <= ord(c) and ord(c) <= ord('z'):
result += chr(ord('a') + ord('z') - ord(c))
else:
result += c
return result
tests = [
("wrw blf hvv ozhg mrtsg'h vkrhlwv?", "did you see last night's episode?"),
("Yvzs! I xzm'g yvorvev Lzmxv olhg srh qly zg gsv xlolmb!!", "Yeah! I can't believe Lance lost his job at the colony!!"),
]
for i, o in tests:
result = solution(i)
print (i, result == o, result, o)