In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains the "python integer and variable knowledge point collation", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's train of thought slowly in depth, together to study and learn "python integer and variable knowledge point collation" bar!
1. Integer number
Python can handle integers of any size, including negative integers, in exactly the same way as mathematically.
two。 Floating point number
Floating-point numbers are decimal numbers. They are called floating-point numbers because the position of the decimal point of a floating-point number is variable according to scientific notation. For example, 1.23x109 and 12.3x108 are exactly equal.
Note: integers and floating-point numbers are stored in different ways inside the computer, and integer operations are always accurate (is division also accurate? Right! While floating-point operations may have rounding errors
3. String
A string is any text enclosed in single or double quotation marks.
The escape character\ can escape many characters, such as\ n for line breaks,\ t for tabs, and the character\ itself is escaped, so the character that\\ represents is\.
If there are many characters in the string that need to be escaped, you need to add a lot of\. To simplify, Python also allows strings inside the string to be unescaped by default.
If there are many line breaks inside the string, it is difficult to read on one line with\ n.For simplicity, Python allows the use of''...''. Represents multiline content in the format of
Multiline string''.'' You can also add r to the front.
4. Boolean value
The representation of Boolean value is exactly the same as that of Boolean algebra, and there are only True and False values for a Boolean value.
Boolean values can be calculated with and, or, and not. The and operation is the and operation, and the result is True only if all the operations are True,and.
Or operation is or operation, as long as one of them is True,or operation, the result is True
The not operation is a non-operation, which is a unary operator that turns True into False,False into True:
5. Null value
A null value is a special value in Python, represented by None. None cannot be understood as 0 because 0 is meaningful and None is a special null value.
6. Variable
Variables can be not only numbers, but also any data type.
A variable is represented by a variable name in the program. The variable name must be a combination of uppercase and lowercase English, numbers and _, and cannot start with a number.
A language in which the type of variable itself is not fixed is called a dynamic language, which corresponds to a static language. A static language must specify a variable type when defining a variable, and an error will be reported if the type does not match when assigning.
7. Constant
The so-called constant is an immutable variable. For example, the commonly used mathematical constant π is a constant. In Python, constants are usually represented by all uppercase variable names
8 Summary:
Assigning x = y to a variable points the variable x to the real object, which is what the variable y points to. The subsequent assignment of variable y does not affect the direction of variable x
Thank you for your reading, the above is the "python integers and variables of knowledge points collation" content, after the study of this article, I believe you on the python integers and variables knowledge points collation of this problem has a deeper understanding, the specific use of the situation also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.