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

silencement
Release: 2020-09-18 08:57:05
Original
25668 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!