Skip to content

Functions (3) code_word(word)

Sam Ruben Abraham edited this page Aug 23, 2020 · 1 revision

Yes - this one codes the word into a sequence of numbers (as in the example mentioned in the prologue). Here's its structure:

def code_word(word):
    '''codes each word with an array of numbers'''
    number_code = []
    i = 0
    for letter in word:
            number_code.append(code_cyclic(i, letter))
            i += 1
    return number_code

You can see that the output of this function is an array. This is what made the output of the upcoming function 'raw'.

Clone this wiki locally