In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to understand everything in python". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to understand everything in python.
The computer is binary, and all data inside the computer is ultimately a binary representation. So how do we present numbers, words, images, sounds, actions, and so on when we use computers? There are many specific presentation methods and steps, which are determined by many factors, such as computer hardware, operating system, software and so on. We can only talk about some abstract concepts here.
Numbers, text, images, sounds, codes, actions, and so on are defined as data.
The data are varied and must be distinguished. The identity used to distinguish data is defined as a label.
The function of the computer is to process the input original data and then output the data. The steps of processing are defined as methods.
Now back to python, everything is an object, so what is an object? My understanding is that objects are the general name of data, labels, and methods.
Here's an example:
A = 65 # defines a variable a, assigned to 65 python sets the label of 65 to int by default, and int is the label of data print (a) type (a) b = chr (a) # defines a variable b, which is processed into strtype "A" by chr () method, and str is the label of data. Chr () is the method. Print (bpencil type (b)) out:65 A
Now I believe we all understand what the object is.
In python, the number number (including int, float, bool, complex), string string, tuple tuple, list list, dictionary dict, collection set, methods, classes, instances, and so on are all composed of data, labels, methods, etc., so everything is an object.
In fact, everything is not completely accurate in python. In python code, symbols such as () [] {} are not objects, they are meaningless, they just help to distinguish between code and data.
But the +, -, *,\, and so on operators are all objects, and they are actually special methods that can be customized by operator overloading.
At this point, I believe you have a deeper understanding of "how to understand everything in 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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.