IDLE exercises

Table of contents

1. Introduction to IDLE

Two, IDLE practical operation

Three, IDLE commonly used shortcut keys

Fourth, the first python program

Five, the basic format of the program



1. Introduction to IDLE

1. IDLE is the official standard development environment for Python. After Python is installed, IDLE is installed at the same time.

2. IDLE already has almost all the functions of Python development (smart syntax prompts, different colors display different types, etc.), and does not require other configurations, which is very suitable for beginners.

3. IDLE is a simple and small built-in Python standard distribution, including basic components such as interactive command lines, editors, and debuggers, which are sufficient for most simple applications.

4. IDLE is written in pure Python based on Tkinter, and the original author is Guido van Rossum, the father of Python.

Two, IDLE practical operation

1. Interactive mode

Start IDLE, the default is to enter the interactive mode.

2. Write and execute Python source files

Three, IDLE commonly used shortcut keys

Fourth, the first python program

print("a")
print("b") 
print("c")

Save the source code to: d:/python_exec/mypy01.py,
click F5 or run-->run module in IDLE to execute this source program.
Small points to note in the first Python program:
1. Do not add spaces at the beginning of lines in the program. Spaces have the meaning of indentation in Python. 2. The symbols are all English symbols, not Chinese. for example:(,"

Five, the basic format of the program

1. Proper spacing and indentation issues

(1) The blanks (spaces and tabs) at the beginning of the logical line are used to determine the indentation level of the logical line, which is used to determine the statement

grouping.

(2) The statement starts at the first column of a new line.

(3) Uniform indentation style:

1 Use a single tab or four spaces per indentation level (the IDE will automatically set tabs to 4 spaces)

2 Python uses indentation instead of {} to represent program blocks

2. Python is case sensitive

3. Notes

(1) Line comments

Add a # sign before each comment. When the interpreter sees #, it ignores the content after this line #

(2) Paragraph comments

Use three consecutive single quotes ('''). When the interpreter sees ''', it scans to the next ''' and ignores them

content between.

Guess you like

Origin blog.csdn.net/m0_68294043/article/details/124290002