Python usage

Python is an interpreted, object-oriented, high-level programming language with dynamic data types.

1. Interactive mode

In Python, Python code entered in interactive mode is executed immediately and the results are output.

Enter the python command on the command line or terminal to enter interactive mode:

Press Ctrl+Z or enter exit() to exit this mode!

image-20231219092403701

2. Script mode

By writing a Python script file (with the .py suffix), you can save multiple lines of code in the file, and then execute these codes through tools such as the command line or an integrated development environment (IDE).

-Write source code

Hold down Ctrl+X, enter Y, then press Enter to save and exit!

Enter python <file_name> in the terminal

image-20231219092450622

3. Jupyter lab

Jupyter Lab is a web-based interactive development environment that supports multiple programming languages.

image-20231214193524924