コード例 #1
0
ファイル: test_strings.py プロジェクト: nolanding/algorithms
 def test_decode(self):
     self.assertEqual(['keon', 'is', 'awesome'],
                      decode("4:keon2:is7:awesome"))
コード例 #2
0
 def test_decode(self):
     self.assertEqual(["keon", "is", "awesome"],
                      decode("4:keon2:is7:awesome"))
コード例 #3
0
 def test_decode(self):
     self.assertEqual(['keon', 'is', 'awesome'], decode("4:keon2:is7:awesome"))
コード例 #4
0
""" 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)