Introduction 

The GADERYPOLUKI is a simple substitution cypher used in scouting to encrypt messages. The encryption is based on short, easy to remember key. The key is written as paired letters, which are in the cipher simple replacement.

The most frequently used key is "GA-DE-RY-PO-LU-KI".

```
 G => A
 g => a
 a => g
 A => G
 D => E
  etc.
```

The letters, which are not on the list of substitutes, stays in the encrypted text without changes.

Task

Your task is to help scouts to encrypt and decrypt thier messages.
Write the `Encode` and `Decode` functions.

Input/Output

The input string consists of lowercase and uperrcase characters and white .
The substitution has to be case-sensitive. 

Example

# GADERYPOLUKI collection



GADERYPOLUKI cypher vol 1


GADERYPOLUKI cypher vol 2


GADERYPOLUKI cypher vol 3 - Missing Key


GADERYPOLUKI cypher vol 4 - Missing key madness

Difficulty: introductory

Starter code:

def encode(message):
	

Solutions:
dict = {i[0]:i[1] for i in ['GA', 'DE', 'RY', 'PO', 'LU', 'KI', 'AG', 'ED', 'YR', 'OP', 'UL', 'IK','ga', 'de', 'ry', 'po', 'lu', 'ki', 'ag', 'ed', 'yr', 'op', 'ul', 'ik'] }
def encode(s):
    return ''.join([dict[i] if i in dict else i for i in s])
    
def decode(s):
    return ''.join([dict[i] if i in dict else i for i in s])


encode = decode = lambda str: str.translate(str.maketrans('gaderypolukiGADERYPOLUKI', 'agedyropulikAGEDYROPULIK'))

def encode(str):
    return str.translate(str.maketrans("GDRPLKAEYOUI"+"GDRPLKAEYOUI".lower(),"AEYOUIGDRPLK"+"AEYOUIGDRPLK".lower()))
    
def decode(str):
    return encode(str)

def encode(message):
    s1 = "GADERYPOLUKI"
    s2 = "AGEDYROPULIK"
    return message.translate(str.maketrans(s1,s2)).translate(str.maketrans(s1.lower(),s2.lower()))
    
def decode(message):
    return encode(message)

key = "GA DE RY PO LU KI"
key += ' ' + key.lower()

# generate translation dictionary
dict = {}
for a, b in key.split():
    dict[a] = b
    dict[b] = a

encode = decode = lambda str: ''.join( dict.get(char, char) for char in str )

t = str.maketrans("gdrplkGDRPLKaeyouiAEYOUI", "aeyouiAEYOUIgdrplkGDRPLK")

encode = decode = lambda s: s.translate(t)

def encode(message):
    return message.translate(message.maketrans("GAgaDEdeRYryPOpoLUluKIki", "AGagEDedYRyrOPopULulIKik"))
    
def decode(message):
    return message.translate(message.maketrans("GAgaDEdeRYryPOpoLUluKIki", "AGagEDedYRyrOPopULulIKik"))

key   = 'GADERYPOLUKI'
key  += key.lower()
dekey = ''.join(key[i:i+2][::-1] for i in range(0,len(key),2))

def encode(message):
    return message.translate(str.maketrans(key,dekey))
    
def decode(message):
    return message.translate(str.maketrans(dekey,key))

key = "GADERYPOLUKI"

def table(key):
    full_key = key.upper() + key.lower()
    even, odd = full_key[::2], full_key[1::2]
    return str.maketrans(even + odd, odd + even)

encode = decode = lambda message: message.translate(table(key))

def encode(s):
    return ''.join(({'G': 'A', 'A': 'G', 'g': 'a', 'a': 'g', 'D': 'E', 'E': 'D', 'd': 'e', 'e': 'd', 'R': 'Y', 'Y': 'R', 'r': 'y', 'y': 'r', 'P': 'O', 'O': 'P', 'p': 'o', 'o': 'p', 'L': 'U', 'U': 'L', 'l': 'u', 'u': 'l', 'K': 'I', 'I': 'K', 'k': 'i', 'i': 'k'})[c] if c in {'G': 'A', 'A': 'G', 'g': 'a', 'a': 'g', 'D': 'E', 'E': 'D', 'd': 'e', 'e': 'd', 'R': 'Y', 'Y': 'R', 'r': 'y', 'y': 'r', 'P': 'O', 'O': 'P', 'p': 'o', 'o': 'p', 'L': 'U', 'U': 'L', 'l': 'u', 'u': 'l', 'K': 'I', 'I': 'K', 'k': 'i', 'i': 'k'} else c for c in s)
decode = encode