#NEWLINE# def sanitise( value ) : #NEWLINE# #INDENT# replace_these = [ '&' , '>' , '<' ] #NEWLINE# replace_with = [ '&amp;' , '&gt;' , '&lt;' ] #NEWLINE# tempvalue = value #NEWLINE# for i in range ( 0 , len ( replace_these ) ) : #NEWLINE# #INDENT# tempvalue = tempvalue . replace ( replace_these [ i ] , tempvalue [ i ] ) #NEWLINE# #UNINDENT# return tempvalue