forked from IvarsKarpics/git_tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexercises.py
More file actions
25 lines (16 loc) · 828 Bytes
/
exercises.py
File metadata and controls
25 lines (16 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import sys
import warnings
def test_deprecation_warning():
warnings.warn("This is a deprecated function, will disappear", DeprecationWarning)
print 'still, the function continues'
def decypher(s):
"""Knowing that k -> m, o -> q, e -> g this function
decyphers the string s and returns readable text."""
return "".join(map(chr, [97+(ord(c)-95)%25 if c.isalpha() else ord(c) for c in s]))
def test_decypher():
test_string = "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle."
assert decypher(test_string) == "i hope you didnt translate it by hand. thats what computers are for. doing it in by hand is inefficient and that's why this text is so long."
def is_vowel(c):
pass
if __name__ == '__main__':
pass