[ create a new paste ] login | about

Link: http://codepad.org/ChPpTG3f    [ raw code | output | fork ]

Python, pasted on Nov 13:
import re

text = raw_input("Text: ")
tokens=text.split(" ")
finaltext=""

print tokens

tDisp = "Disp"
tPrompt = "Prompt"
tString = "\""
tH = "H"
tE = "E"
tL = "L"
tO = "O"


for i in tokens:
    if (i == tDisp):
        finaltext += "$DE"
    if (i == tPrompt):
        finaltext += "$DD"
    if (i == tString):
        finaltext += "$2A"
    if (i == tH):
        finaltext += "$48"
    if (i == tE):
        finaltext += "$45"
    if (i == tL):
        finaltext += "$4C"
    if (i == tO):
        finaltext += "$4F"
    




print finaltext


Output:
1
2
3
4
Text: Traceback (most recent call last):
  Line 3, in <module>
    text = raw_input("Text: ")
EOFError


Create a new paste based on this one


Comments: