Delete key doesn't work normally inside the Python Script editor. It is possible to select letters, words or lines with mouse and then press Delete key to erase those.