约 314 字
约 2 分钟
说明:返回对象的 ID。
def id(obj): ''' 返回对象的 ID :param obj: 一个对象 :return: 对象的 ID '''
示例:
print(id('hello world')) print(id([1, 2, 3, 4, 5])) print(id(object())) 运行代码>>> Establishing WebAssembly Runtime. >>> Standby. Powered by Shift.
print(id('hello world')) print(id([1, 2, 3, 4, 5])) print(id(object()))
>>> Establishing WebAssembly Runtime.
>>> Standby.
Powered by Shift.
创建于 2025/5/9
更新于 2025/5/11