网站开发的流行架构,wordpress文件下载页面,筛选选功能形网站建设,wordpress中文标签打不开目录
一.Python id 函数简介二.Python id 函数使用三.猜你喜欢 零基础 Python 学习路线推荐 : Python 学习目录 Python 基础入门 一.Python id 函数简介
每个人都有对应的身份证号码#xff0c;并且唯一#xff01;反之亦然#xff0c;一个身份证号码必然对应一个…目录
一.Python id 函数简介二.Python id 函数使用三.猜你喜欢 零基础 Python 学习路线推荐 : Python 学习目录 Python 基础入门 一.Python id 函数简介
每个人都有对应的身份证号码并且唯一反之亦然一个身份证号码必然对应一个人
**id 函数返回对象的唯一标识符标识符是一个整数该标识符就是存放该对象的内存地址**语法如下 参数说明object — 对象
返回值 : 返回object对象内存地址.id([object])二.Python id 函数使用
可以通过 Python 内置函数 id 查看对象的内存地址示例代码如下
# !usr/bin/env python
# !usr/bin/env python
# -*- coding:utf-8 _*-Author:猿说编程
Blog(个人博客地址): www.codersrc.com
File:Python id 函数.py
Time:2021/3/23 00:37
Motto:不积跬步无以至千里不积小流无以成江海程序人生的精彩需要坚持不懈地积累
a 10 # 整数类型
b False # bool类型
c 10.55 # 浮点数类型
d 123 # 字符串类型
e (apple, banana, cherry) # 元祖类型
f {name:zhangsan,age:18} # 字典串类型
g [456,False,123] # 列表类型print(id(a))
print(id(b))
print(id(c))
print(id(d))
print(id(e))
print(id(f))
print(id(g))
输出结果
140682288640544
140682288407904
140682280310736
140682279242928
140682279663488
140682280100544
140682280146368三.猜你喜欢
Python 简介Python Pycharm Anacanda 区别Python2.x 和 Python3.x如何选择Python 配置环境Python Hello World 入门Python 代码注释Python 中文编码Anaconda 是什么Anconda 下载安装教程Pycharm 提示this license **** has been cancelledPycharm 设置开发模板/字体大小/背景颜色
未经允许不得转载猿说编程 » Python id 函数