directory
- A brief introduction to the Python ID function
- The Python id function is used
- Guess you like it
Recommended path for learning Python: Python Learning Directory >> Python Basics
A brief introduction to the Python ID function
Everyone has the corresponding ID number, and only! Vice versa, one ID card number necessarily corresponds to one person;
The **id function returns the unique identifier of the object, which is an integer. The identifier is the memory address where the object is stored. ** Syntax:
Parameter Description: object - Object Return value: Returns the memory address of the object. Id ([object])Copy the code
The Python id function is used
You can view the memory address of an object using the Python built-in function ID, as shown in the following code:
#! usr/bin/env python # ! Usr /bin/env python # -* -coding :utf-8 _*- "" www.codersrc.com @file :Python ID function. py @time :2021/3/23 00:37 @motto: A thousand miles without a single step, a river without a small stream, the wonderful life of the program needs to be accumulated with perseverance! """ A = 10 # integer type b = False # bool type C = 10.55 # floating point type D = "123" # string type e = ('apple', 'banana', Print (id(a) print(id(b)) print(id(b)) print(id(b)) (c) print (id) print (id) (d) print (id) (e) print (id (f)) print (g) (id) "' output: 140682288640544 140682288407904 140682280310736 140682279242928 140682279663488 14068228080100544 140682280146368"Copy the code
Guess you like it
- Introduction of Python
- Python Pycharm Anacanda difference
- Python2.x and python3. x, how to choose?
- Python Configuration Environment
- Introduction to Python Hello World
- Python code comments
- Python Chinese encoding
- What is Anaconda? Anconda download the installation tutorial
- Pycharm prompt: this license **** has been cancelled
- Pycharm Sets the development template/font size/background color
Python id function
This article is published by the blog – Ape Say Programming Ape Say programming!