[ create a new paste ] login | about

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

Python, pasted on Nov 13:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
text = "Disp Prompt Disp"
tokens= text.split(" ")

finaltext=""

disp = "Disp"
prompt = "Prompt"

for i in tokens:
 if (i == disp):
  finaltext += "$DE"
 if (i == prompt):
  finaltext += "$DD"

print finaltext


Output:
1
$DE$DD$DE


Create a new paste based on this one


Comments: