Python Tutorial 2: The First Python Program
Target
- first
HelloPython
program- Introduction to Python
2.x
and3.x
versions- Three ways to execute Python programs
– Interpreter –python/python3
– Interactive –ipython
– Integrated development environment –Pycharm
1. The first HelloPython program
1.1 Basic concepts of Python source program
- The Python source program is a text file in a special format that can be developed using any text editing software
Python
. - The file extension for Python programs is usually
.py
.
1.2 Exercise steps
Create a new file under the folder 01-HelloPython.py
and use the editor to enter the following content
print("Hello Python")
print("Hello World")
Open cmd, locate the path where the file is located, and enter python 01-HelloPython.py
to view the running results:
python
the first function in