Differences between revisions 1 and 5 (spanning 4 versions)
Revision 1 as of 2008-08-04 04:11:41
Size: 523
Editor: RexChen
Comment:
Revision 5 as of 2009-11-29 02:27:14
Size: 458
Editor: Elias
Comment: 删除对PageComment2组件的引用
Deletions are marked like this. Additions are marked like this.
Line 8: Line 8:
==基本操作== == 基本操作 ==
Line 32: Line 32:
创建 by -- RexChen[[[DateTime(2008-07-29T00:17:22Z)]]]
||<^>[[PageComment2]]||<^>[:/PageCommentData:PageCommentData]''||
创建 by -- RexChen[[[DateTime(2008-08-04T00:11:22Z)]]]

Dictionary

Python中的字典,就像Ruby中的Hash、Java中的Map一样,保存着数据的键值对。

基本操作

创建

   d = {"key1":"val1", "key2":"val2"}

修改

   d["key1"] = "other"

删除一个元素

   del d["key1"]

删除所有元素

   d.clear()


反馈

创建 by -- RexChen[DateTime(2008-08-04T00:11:22Z)]

RexChen/Dictionary (last edited 2009-12-25 07:14:30 by localhost)