Python Programming Second test report (confirmatory test)

An-Hui Engineering University

  Python programming  test report

Class    Logistics 192    Name Chang Yi-ming school number 3190505225    scores              

Date    2020.3.22      instructor        repair buildings

[Title] Experiment     Experiment two sequential Structured Programming (confirmatory test)

 

 【Purpose】  

(1) Method of control of input and output data;

(2) structure of the program execution in order familiar statements;

(3) Design of the sequence control structure of the program.

[Experiment Conditions]  

PC or remote programming environment

 

[Experimental] content

1, completed three programming problems. (Python123)

( 1 ) Calculation of the area of a circle calculated S

Problem Description:

The calculated area of ​​a circle radius of the circle, radius 25. Please write and run the following code:

radius = 25 # 25 is the radius of a circle

area = 3.1415 * radius * radius # circular area is calculated according to the formula

print ( "{:. 2f}". format (area)) # outputs only two decimal places the result

input Output:

Input: None Output: 1963.44

 

( 2 ) sum

Questions Question:

Programming, input from the keyboard two numbers x, y, find x, y and assigned to the sum of s, the final output s.

input Output:

 

( 3 ) Determine the volume of a sphere

Problem Description:

Enter the radius of the sphere, the sphere volume calculation. 

input Output:

Input: A positive number

Output: the volume of the ball, as a result two decimal places

[Experimental recording and analysis]

(Please fill in the experimental records and analysis results)

1. Calculation circular area

Experiments recorded as follows

 

 

2. The sum

Experiments recorded as follows:

 

 

3. Calculation sphere volume

Experiments recorded as follows

 

 

[Questions] (be careful not to leak A)

1, question 1 What influence factors and calculation accuracy of 3 questions? How to make a value of 1 and 3 to get a more accurate? (You can try on the local computer, or self-programmed on python123)

Input values ​​of the factors are related to the circumference, a value of 3.1415, but if the value is more precise, such as: 3.141592, the result is more accurate.

 

Guess you like

Origin www.cnblogs.com/1750875376qq/p/12548162.html