Home  >  Article  >  Backend Development  >  What should I do if I make a mistake when writing python code?

What should I do if I make a mistake when writing python code?

silencement
silencementOriginal
2019-05-22 17:02:2525650browse

Solution: 1. Write code in python shell. If you accidentally make a mistake, you can modify it directly, and it is convenient to change lines, which is very convenient. 2. Writing code in ipython is very helpful for beginners to practice the basics of python.

What should I do if I make a mistake when writing python code?

#In the process of learning python and writing code by hand, errors will inevitably occur. If you write it on the command line or in the Python interactive environment, you can only run the code once each time. If you want to modify the code, you need to rewrite it. How to deal with this situation?

1. Write code in python shell, as follows

What should I do if I make a mistake when writing python code?

Write code in shell. If you accidentally make a mistake, you can modify it directly, and It’s very convenient to change lines.

2. Write code in ipython.

What should I do if I make a mistake when writing python code?

#ipython is very helpful for beginners to practice the basics of python.

The above is the detailed content of What should I do if I make a mistake when writing python code?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn