小白教程
所有教程
关于
Search
172.70.130.161
172.70.130.161
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Python func hash”的源代码
本页内容
上一节:
Python_func_delattr
下一节:
Python_func_memoryview
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:hash()}}[[Category:python3 built in functions|66]] = Python hash() 函数 = [[python built in functions|Python 内置函数]] == 描述 == '''hash()''' 用于获取取一个对象(字符串或者数值等)的哈希值。 == 语法 == hash 语法: <sample title="" desc="" lang="python" hererun="1"> hash(object) </sample> 参数说明: * object -- 对象; == 返回值 == 返回对象的哈希值。 以下实例展示了 hash 的使用方法: <sample title="" desc="" lang="python" hererun="1"> >>>hash('test') # 字符串 2314058222102390712 >>> hash(1) # 数字 1 >>> hash(str([1,2,3])) # 集合 1335416675971793195 >>> hash(str(sorted({'1':1}))) # 字典 7666464346782421378 >>> </sample> [[python built in functions|Python 内置函数]]
返回至“
Python func hash
”。
上一节:
Python_func_delattr
下一节:
Python_func_memoryview