python needs analysis

Chapter 3: Requirements Analysis
Demand analysis tasks: ???

Functional Analysis
Performance Analysis
EG: response time, main memory capacity, disk capacity, security, and other
reliability and availability,
error handling needs of
the system finds an error actions, mainly in the key part of the system settings
interface requirements
user interface, hardware interface, software interface, a communication interface
constraints
precision tools and languages, design constraints, constraints of hardware, standards
reverse demand
future requirements may make
physical contact FIG
state transition diagram
ER FIG.

python function:
We know the area of the circle is calculated as:
S = 2 [pi] r
if we know the value of the radius r, the area can be calculated according to the formula. Suppose we need to calculate three different sizes of
area of a circle:
R1 = 12.34
R2 = 9.08
R3 = 73.1
S1 = 3.14 * R1 * R1
S2 = 3.14 * R2 * R2
S3 = 3.14 * R3 * R3
when code appears regularly repeated , you need to be careful, each write 3.14 * x * x is not only very troublesome, but, if we want to change the time 3.14159265359 of 3.14, have to replace all.

With the function, we are no longer each write s = 3.14 * x * x, but written in a more meaningful function call = S
area_of_circle (the X-), and the function area_of_circle itself just need to write once and can be called multiple times.

Basically all of the high-level language support functions, Python is no exception. Python not only very flexibly defined functions, and it built itself a lot of useful functions can be called directly.

Abstract
abstract mathematics is a very common concept. For example:
calculating the number of columns and, for example: 1 + 2 + 3 + ... + 100, very inconvenient to write, then mathematician who seek
and [Sigma symbols, can be 1 + 2 + 3 + ... + 100 referred to as :

 

 

 

 

 

 

 

 

 

 


Summary
defining a function, it is necessary to determine the function name and the number of arguments
, if necessary, to make checks on the data type parameter;
the functions that can return a function result with return at any time;
when the function is finished and no return statement, automatically return None.
Function can return multiple values simultaneously, but in fact is a tuple
--------------------- 

Guess you like

Origin www.cnblogs.com/hyhy904/p/10947640.html