Recall method: Under the Windows operating system, you can use "backspace" to recall the entered characters; under some Unix-like systems, you can use "delete" to recall the entered characters; under Ubuntu, use " ctrl backspace" to recall the entered characters.
The operating environment of this tutorial: windows7 system, python3 version, Dell G3 computer.
How to delete input errors in python?
Python's commonly used input function raw_input(), if you make a mistake during the input process, you cannot backspace to cancel the entered characters like you can on the command line, and you have to re-enter.
How can I cancel the input character backspace similar to the command line?
This problem is caused by different operating systems:
Under the Windows operating system, if raw_input() makes a mistake during the input process, you can use backspace cancels the entered characters;
In some Unix-like systems, delete is used instead of backspace;
Under Ubuntu , delete will not work, but ctrl backspace will.
Related free learning recommendations: python video tutorial!
The above is the detailed content of How to undo the wrong typing in python. For more information, please follow other related articles on the PHP Chinese website!