-
Notifications
You must be signed in to change notification settings - Fork 283
/
peep.py
52 lines (37 loc) · 1.29 KB
/
peep.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
def peep(p, e):
"""
Determine whether or not peep = pp^e
Inputs:
p (int): first digit
e (int): second digit
Returns: True if peep = pp^e, False otherwise
"""
### Replace pass with your code
pass
#############################################################
### ###
### Testing code. ###
### !!! DO NOT MODIFY ANY CODE BELOW THIS POINT !!! ###
### ###
#############################################################
import sys
sys.path.append('../')
import test_utils as utils
def do_test_peep(p, e, expected):
recreate_msg = utils.gen_recreate_msg("peep", *(p, e))
actual = peep(p, e)
utils.check_none(actual, recreate_msg)
utils.check_type(actual, expected, recreate_msg)
utils.check_equals(actual, expected, recreate_msg)
def test_peep_1():
do_test_peep(p=1, e=3, expected=True)
def test_peep_2():
do_test_peep(p=3, e=1, expected=False)
def test_peep_3():
do_test_peep(p=0, e=1, expected=False)
def test_peep_4():
do_test_peep(p=1, e=0, expected=False)
def test_peep_5():
do_test_peep(p=1, e=2, expected=False)
def test_peep_6():
do_test_peep(p=2, e=3, expected=False)