In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article is to share with you about the digital types of Python | Python. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article. Without saying much, let's take a look at it with the editor.
Numeric type of Python
The numeric type Number in the Python program is used to store values. At first, Python3 only supports int, float, bool and complex, and removes the long type from Python2. I'll describe the four numeric types in python3 in detail below.
Integer (int)
Integers (int) are integers and do not contain decimal points. In Python, you can also use 0 + "base standard" + numbers to represent different base numbers.
For example, the number of OBO + is octal.
The number of 0,0xapple X+ is hexadecimal.
The number of 0binary b _ b _ B+ is binary
A decimal system without a decimal character
The following demonstrates the mathematical operations related to plastic surgery
Floating point (float)
Floating point is a combination of integers and decimals, such as 12.5 is a floating point number. Floating-point types can also be represented by scientific counting, such as 125=1.25e2. Integers and floating-point numbers are stored in different ways inside the computer, the operation of integers is absolutely accurate, but the operation of floating-point numbers may have rounding errors.
Boolean (Boolean)
Boolean is a little different from the above two types in that it is a simple type that represents logical values, that is, right and wrong, and the logical relationship between right and wrong. Boolean values can only be either true or false. In python, the only Boolean values are True and False, which are used to represent logical "true" and "false". The values are 1 and 0, respectively.
Here are a few simple examples of Boolean usage
Plural (complex)
The plural type (complex) consists of a real part and an imaginary part, and can be represented by complex (amenb) or a+bj. Where the real part an and the imaginary part b are floating point.
These are the number types of Python | Python. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.