CDA Data Analyst Produce
author :CDA The star lecturer Cao Xin
edit :Mika
Python To the power of
http://mpvideo.qpic.cn/
Power at Python What to do inside , We may want to say whether to use 2^3 You can find the power , It's not .
This is in Python There is a bitwise XOR budget , It is related to binary , We know it's not meant to do power operations ok 了 .
The actual result is 1.
The real power is 2 individual **,1 individual * It's a ride .
2 individual ** Is to find the power ,2 The third power of is 8.
You must remember this .
Python The maximum value of a floating-point number http://mpvideo.qpic.cn/
Sometimes we use the maximum value of a floating-point number , So in Python How to get it inside ?
First of all import sys This package ,import After that , use sys. Inside float_info, Then use its max This function .
In this way, you can get the maximum value of the floating-point number , Have you learned ?
Python The infinity of floating point numbers
http://mpvideo.qpic.cn/
stay Python You want to get the infinity of floating point numbers in , How to get it ?
We directly float , Add a inf Namely infinity Abbreviation for Infinity , In this way, we can obtain the infinity of floating point numbers .
Come and try it , You will know when you need it