Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the standard data types of python

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article focuses on "what are the standard data types of python". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn what are the standard data types of python.

The nature of the program

For the nature of the program, there is a highly concise summary, and is recognized by most people, this sentence is "algorithm + data structure = program". The data structure studies how to store the data and the algorithm studies how to use the data.

Any meaningful program is dealing with data. To put it simply, a meaningful program must have input data and output data. So, every program you write is dealing with data. From this point of view, in the process of learning programming, the first thing you need to understand is the data.

There are types of data that must be kept in mind. This is like primary school students know that integers, decimals, positive numbers, negative numbers, are numbers, but they are differentiated, similarly, in python, the data is also differentiated, they have their own types. Python provides six standard data types, which are Number (number), String (string), List (list), Tuple (tuple), Sets (collection), and Dictionary (dictionary).

Number

If you want to master programming, then you must first master the data, there is no data, there is no program. I will explain each of the six standard data types one by one in the next few articles. Today I will first talk about Number digital types. Numeric data types, which are used to store numeric values, sound like a mouthful. Take a look at the example below.

There are four data types under Number, which are

Int Integer 333

Long long integer 93435454444444545

Float floating point 3.14

Complex complex number

Complex basically won't use it, so I won't explain it. When the data types are listed above, a specific example is given later. If you look at it a little bit, you can find such a rule. Int and long are integers, while float has a fractional part, and the data of long type is larger than that of int type. This observation is accurate. You can simply think that what has a decimal is the float type, so how to distinguish int and long depends on the specific size of the value. On a 32-bit machine, the size range of the int type is-21474836482147483647, and on a 64-bit machine, the size range of the int type is-2147483647. On a 64-bit machine, the size range of the int type is-2147483647, that is,-9223372036854775808. The integer outside this range is the long type.

You may wonder, what's the use of these things? If you have such doubts, please answer two questions. How old are you? How much did you pay for the python tutorials? For the first question, your answer must be an integer, which happens to be the int type, and the price of a book usually has a decimal, which happens to be the float type, which is the use of data types, procedures are used to deal with data, and real-life data is complex, so every programming language should specify data types in order to deal with real-life problems.

At this point, I believe you have a deeper understanding of "what are the standard data types of python". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report