Use in Python simple math, random module

Use in Python simple math, random module

math

math, math library name suggests; Python mathematical operation are substantially common math function module, which provides a number of floating-point math functions.
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Execution results are as follows:
Here Insert Picture Description
Here Insert Picture Description

random module

Python standard library of random function generates a random floating point, integer, string, and a randomly selected element of the list in the sequence, disrupting a set of data;
Here Insert Picture Description
Here Insert Picture Description
execution results as shown below:
Here Insert Picture Description

The module random Numpy

Here Insert Picture Description
Execution results are as follows:
Here Insert Picture Description
Here Insert Picture Description
Results of the following:
Here Insert Picture Description

Published 21 original articles · won praise 6 · views 8011

Guess you like

Origin blog.csdn.net/weixin_42128329/article/details/100317559