Python. i need help programming
Question: I am trying to write a program that i can enter text in to, then it will
display the numbers that each letter in a sentence represents. eventually. i
would like to be able to input a sentence and have it change it to "giberish".
sort of like an encoder or something. any thoughts.

    
    
    a = 1
    b = 2
    c = 3
    d = 4
    e = 5
    f = 6
    g = 7
    h = 8
    i = 9
    j = 10
    k = 11
    l = 12
    m = 13
    n = 14
    o = 15
    p = 16
    q = 17
    r = 18
    s = 19
    t = 20
    u = 21
    v = 22
    w = 23
    x = 24
    y = 25
    z = 26
    text = eval(input("message: "))
    
    print(text)
    


Answer: 
    import re
    numbers  = map(ord, 'your message here')
    strNumber = map(lambda x:"%03d"%x, numbers)
    print ''.join(strNumber)
    
    # Output: 121111117114032109101115115097103101032104101114101
    
    # Reverse: Decoding
    strNumber = re.findall(r"\d\d\d", "121111117114032109101115115097103101032104101114101")
    numbers  = map(int, strNumber)
    chars = map(chr, numbers)
    print ''.join(chars)
    

  1. Apply ord() on every character of the message to get ASCII value of character <http://docs.python.org/2/library/functions.html#ord> and <http://docs.python.org/2/library/functions.html#map>
  2. Convert every number into a char-length 3 string 
  3. Merge all 3-char-length sub-strings to get encoded string

# Another way of doing same thing:

    
    
     message = 'Your message here'
     codedMsg = ''
     for character in message:
         codedMsg = '%s%03d'%(codedMsg, ord(character))
    
     print codedMsg      
    

