Experiment 1: IDLE familiar and online programming platform

An-Hui Engineering University

  Python programming  test report

Class    Logistics 192    Name Liu Xu student number 3190505212 scores               

Date      2020.3.3      instructor        repair buildings     

Experiment name   Experiment a familiar IDLE and online programming platform

Purpose   

1. master the installation and use of python IDLE integrated development environment

2. familiar with online programming platform

3. grasp the basic python programming, compile and run the program

 

Content Experiments

1, in accordance with the experimental installation guide IDLE, try to run python interactive and batch programs run python program in two ways.

Chapter 2 rows textbook temperature conversion sample program. During operation

(1) observed syntax highlighting and automatic indentation.

(2) (emphasis) human error correction procedures are in accordance with the following conditions, try to run the program, and observations were recorded error IDLE given to find information through the network finish analyzing the wrong meaning.

a) modify the indentation of a row is three spaces

b) The Image elif elfi to print or wrong prinnt

c) one of the quotes "" was changed to Chinese references ""

d) a row of the colon is removed

e) a row of the English parentheses () is rewritten as Chinese parentheses ()

f) to a row in parentheses () becomes a removed (  

3, try python123 online programming function;

https://www.python123.io/

 

Experiment recording and analysis

1, in accordance with the experimental installation guide IDLE, try to run python interactive and batch programs run python program in two ways.

 

2, the temperature shift assay

(1) observed syntax highlighting and automatic indentation.

  Syntax highlighting: to different code elements using a different color for display. By default, the keyword is displayed as orange, comment display red, green string, the output of the definitions and explanations are displayed in blue, brown console output display. As you type the code, it will be automatically applied highlighted in color.

  IDLE提供自动缩进功能,能将光标定位到下一行的指定空距处。当键入与控制结构对应的关键,如if等,或者输入如def等与函数定义对应的关键字的时候,按下回车键后IDLE就会启动自动缩进功能。

(2)实验中出现的错误:把英文分号 : 错写成中文分号 :

 

 

 

  改正后:

 

(3)人为按照以下情况分别把程序改错,尝试运行程序,并观察结果记录IDLE给出的错误提示,通过完网络查找资料,分析错误的含义。

 a)把某行的缩进修改为3个空格(结果:缩进有误)

 

 b)把关键词elif 改为 elfi,或者print 写错 prinnt(结果:无效语法)

 

 c)把某一个英文引号""修改为中文引用“”(结果:标识中存在无效字符)

   

 d)把某行的冒号去掉(结果:无效语法)

 

 e)把某行的英文括号( )改写为中文括号()(结果:标识中存在无效字符)

 

 f)把某行括号()去掉一个变为 ( (结果:无效语法)

 

 

 

 

3、尝试 python123的在线编程功能

 

 

 

拓展: 通过网络查找感兴趣的 python 小程序,或编程社区或项目

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/LX1234/p/12405305.html