PYTHON:
Create a function named decode(AN ENCODED STRING) that decodes an encoded string.
The encoding-decoding system is given in the following list of tuples named t:
The first element of each tuple represents the encoded value (e.g., 'key' in a dictionary) and the second element represents the decoded value (e.g., 'value' in a dictionary).
The output should also be a string. For example, decode('@jjzq') returns 'apple'.
In the case where a character cannot be found in t, please decode this unknown character using any character (or any combination of characters) of your choice. (Why not alphabets? You may not want to change the actual meaning of the reading.)
t = [('@','a'), ('*','b'), ('y','c'), ('u','d'), ('q','e'), ('m','f'), ('i','g'), ('e','h'), ('a','i'), ('-','j'), ('5','k'), ('z','l'), ('v','m'), ('r','n'), ('n','o'), ('j','p'), ('f','q'), ('b','r'), ('+','s'), (',','t'), ('?','u'), ('w','v'), ('s','w'), ('o','x'), ('k','y'), ('g','z'), ('c',' '), ('&','.'), ('.',','), ('!',':'), ('x','('), ('t',')'), ('p','@'), ('l',"#"), ('h','$'), ('d','!'), ('_','1'), ('^','2'), ('3','3'), ('1','4'), ('0','5'), ('2','6')]