June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -13,10 +13,13 @@ def encode(input_string):
|
|||
else:
|
||||
count += 1
|
||||
else:
|
||||
entry = (character,count)
|
||||
lst.append(entry)
|
||||
return lst
|
||||
|
||||
try:
|
||||
entry = (character,count)
|
||||
lst.append(entry)
|
||||
return (lst, 0)
|
||||
except Exception as e:
|
||||
print("Exception encountered {e}".format(e=e))
|
||||
return (e, 1)
|
||||
|
||||
def decode(lst):
|
||||
q = ""
|
||||
|
|
@ -25,5 +28,7 @@ def decode(lst):
|
|||
return q
|
||||
|
||||
#Method call
|
||||
encode("aaaaahhhhhhmmmmmmmuiiiiiiiaaaaaa")
|
||||
decode([('a', 5), ('h', 6), ('m', 7), ('u', 1), ('i', 7), ('a', 6)])
|
||||
value = encode("aaaaahhhhhhmmmmmmmuiiiiiiiaaaaaa")
|
||||
if value[1] == 0:
|
||||
print("Encoded value is {}".format(value[0]))
|
||||
decode(value[0])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue