Ejemplo n.º 1
0
 def test_encode(self):
     self.assertEqual("4:keon2:is7:awesome", encode("keon is awesome"))
Ejemplo n.º 2
0
 def test_encode(self):
     self.assertEqual("4:keon2:is7:awesome", encode("keon is awesome"))
""" Design an algorithm to encode a list of strings to a string.
 The encoded mystring is then sent over the network and is decoded
 back to the original list of strings.
"""
from algorithms.strings import encode, decode

alist = "ab bc cd ef"

b = encode(alist)
print(b)

c = decode(b)
print(c)