栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

Python内置函数hash()

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Python内置函数hash()

hash(object)

Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32
Type help , copyright , credits or license() for more information.
 var 12
 hash(var)
 var 12 
 hash(var)
2881029940170453192
 var 12.0
 hash(var)
 var (0,1,2)
 hash(var)
1267305975155491464
 var [0,1,2]
 hash(var)
Traceback (most recent call last):
 File pyshell#11 , line 1, in module 
 hash(var)
TypeError: unhashable type: list 
 var set(2,3,4)
Traceback (most recent call last):
 File pyshell#13 , line 1, in module 
 var set(2,3,4)
TypeError: set expected at most 1 arguments, got 3
 var set([2,3,4])
{2, 3, 4}
 hash(var)
Traceback (most recent call last):
 File pyshell#16 , line 1, in module 
 hash(var)
TypeError: unhashable type: set 
 var {0,1,2}
 hash(var)
Traceback (most recent call last):
 File pyshell#18 , line 1, in module 
 hash(var)
TypeError: unhashable type: set 
 var {0:999,1:888}
{0: 999, 1: 888}
 hash(var)
Traceback (most recent call last):
 File pyshell#22 , line 1, in module 
 hash(var)
TypeError: unhashable type: dict 
 var abc 
 hash(var)
-9146920486740483374
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/267459.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号