码迷,mamicode.com
首页 > 编程语言 > 详细

thinkpython2

时间:2016-04-14 19:35:14      阅读:450      评论:0      收藏:0      [点我收藏+]

标签:python

1) Dictionaries have a method called get that takes a key and a default value.

  

  LookupError is a built-in exception used to indicate that a lookup operation failed.

  raise LookupError(‘value does not appear in the dictionary‘)


  A dictionary is implemented using a hashtable and that means that the keys have to be     hashable. A hash is a function that takes a value (of any kind) and returns an integer.   Dictionaries use these integers, called hash values, to store and look up key-value     pairs.

 

本文出自 “7773725” 博客,请务必保留此出处http://7783725.blog.51cto.com/7773725/1763854

thinkpython2

标签:python

原文地址:http://7783725.blog.51cto.com/7773725/1763854

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!