20192307 2019-2020-2 "Python Programming" Experiment 2 Report

20192307 2019-2020-2 "Python Programming" Experiment 2 Report

Course: "Python Programming"
Class: Class 1923
Name: Chang Wanli
Student ID: 20192307
Experimental Teacher: Wang Zhiqiang
Experimental Date: April 11, 2020
Compulsory / Elective: Public Elective Course

1. Experimental content

  • Design and complete a complete application program, complete operations such as addition, subtraction, multiplication and division, and more functions.
  • Examine the knowledge points of basic grammar, judgment statements, loop statements, logical operations, etc.

2. Experimental requirements

  • Create engineering projects, use Python language to achieve specific operation calculations, and complete program debugging and running, and the code is hosted to the code cloud.

3. Experimental process and results

In order to improve code reuse and maintainability, in the preparation of this program, I used two modules. Main program and function function program respectively. This avoids confusion in the program and makes it difficult to correct errors.
This is the main program code: use multiple branches to achieve different calculations.

This is the function function program code: The

following screenshot is the running result of this calculator:

In order to debug the feasibility of the code, multiple breakpoints are set for the main program and distributed for debugging.

Code cloud link : https://gitee.com/python_programming/chang_wanli/commit/d18e72cf51822708834dc756e5c2613e1aa3435c

4. The problems encountered during the experiment and the resolution process

  • Problem 1: ImportError is encountered when calling the function module file
  • Solution to Problem 1: Mark root dictionary, after re-finding the root directory, you can call the function of the function module.
  • Question 2: When performing a square root operation, when calling a function, it always prompts that the function is not available.
  • Solution to Problem 2: After querying information online, it is understood that the sqrt function needs to call math before it can be used normally.
  • ...

Others (sentiment, thinking, etc.)

In the course of this experiment, I encountered many problems, including not only knowledge loopholes, but also carelessness caused by inattentiveness, all of which supplement, improve, and enrich my python language knowledge system. In the process of constantly fixing problems, I used many ways to query information, such as: "Python Programming: From Entry to Practice", "[Stupid Way] Learn Python3 (Third Edition)", Blog Park Platform, CDSN Platform, Code cloud platform, know the app and so on. In the preparation of these programs, I was further familiar with the use and operation of the IDE platform of vscode, especially for the function writing and calling of different modules, the application and understanding of classes and objects, for my next Python language program design Learning has laid a solid foundation and gradually improved myself in the process of continuous exploration.

References

  • "Python Programming: From Entry to Practice"
  • "[Stupid Way] Learn Python3 (Third Edition)"
  • "Python Basic Tutorial (3rd Edition)"
  • "Python Core Programming (3rd Edition)"

Guess you like

Origin www.cnblogs.com/20192307CWL/p/12716833.html