Python installation and the first line of Python program [Baizhan Programmer]
No matter what tools are used to develop Python programs, the Python operating environment must be installed. Currently the most commonly used platforms are Windows and Linux. Since the number of people using Windows is the largest, we will focus on Windows 10. At the same time, we use python3.10 version as the main teaching version.
> > ⚠️In fact, programming has little to do with the platform. You can also use Linux, Mac. >
Building Python environment under Windows platform
Step 1: Enter the python official website (python.org) to download the python installation package
Step 2: Install the downloaded python.exe
> > ⚠️Run python.exe as administrator >
> > Select the “Add Python 3.10 to Path” checkbox at the bottom of the interface, so that the installer will automatically add the Python path to the PATH environment variable. >
Step 3: run python
Enter cmd in the windows search command, enter the command line window, and then enter: python
Type print(“hello world”)
Real-time effect feedback
1. What needs to be done to enable python to be used in the windows command line?
A After the default installation, you can use it freely without any operations
B When installing, select the Add Python 3.10 to path check box
C Install python to the c drive
D Install python in the c:/windows directory
2. The following python code, what results will be printed?
1
print(“hello world”)
A is missing a semicolon, an error is reported
B missing comma, error
C can be executed normally, and print out “hello world”
D can be executed normally and print out hello world
Answer
1=>B 2=>D
Latest Programming News and Information | GeekBar