From 8124382a8f6b4b461abadfe1391bd2621ed81700 Mon Sep 17 00:00:00 2001 From: Seongbeom Park Date: Tue, 10 May 2022 23:08:48 +0900 Subject: [PATCH] finish extra/i-love-lance-janice Submitting solution... Submission: SUCCESSFUL. Completed in: 34 mins, 26 secs. --- README.md | 3 +++ extra/i-love-lance-janice/solution.py | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 extra/i-love-lance-janice/solution.py diff --git a/README.md b/README.md index fe116a7..e9a590b 100644 --- a/README.md +++ b/README.md @@ -108,3 +108,6 @@ CFcSBwgCCBoHRhkKU1cGAA4AGU5YQR5THBwNFwoGGAxTQQMQVBUSBg4EAAwQRhUQVBUHFAQTGRpT QQM ### skipping-work * Completed in: 20 mins, 58 secs. + +### i-love-lance-janice +* Completed in: 34 mins, 26 secs. diff --git a/extra/i-love-lance-janice/solution.py b/extra/i-love-lance-janice/solution.py new file mode 100644 index 0000000..98485e8 --- /dev/null +++ b/extra/i-love-lance-janice/solution.py @@ -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)