


Then you can copy, paste, or edit the examples by adding them after the > prompt. Info: To follow along with the example code in this tutorial, open a Python interactive shell on your local system by running the python3 command. If you don’t have a programming environment set up, you can refer to the installation and setup guides for a local programming environment or for a programming environment on your server appropriate for your operating system (Ubuntu, CentOS, Debian, etc.) Comment SyntaxĬomments in Python begin with a hash mark ( #) and whitespace character and continue to the end of the line. You should have Python 3 installed and a programming environment set up on your computer or server. In general, it is a good idea to write comments while you are writing or updating a program as it is easy to forget your thought process later on, and comments written later may be less useful in the long term. Using comments in programs can make code more readable for humans, as it provides some information or explanation about what each part of a program is doing.ĭepending on the purpose of your program, comments can serve as notes to yourself or reminders, or they can be written with the intention of other programmers being able to understand what your code is doing. Comments are lines that exist in computer programs that are ignored by compilers and interpreters.
