2005年11月20日 星期日 23:01
以下
是一个dictionary:
>>> d
{0: [[0, 1], [0, 2]], 1: [[0, 1], [1, 2], [1, 3]], 2: [[0, 2], [1, 2],
[2, 3]], 3: [[1, 3], [2, 3]]}
在第一个KEY后,发现1和
2在其它地方有在一起,所以把1,2放在一起,否则就不考虑.
设计一个dictionary,
想让dicTry=
{0: [[0, 1,2], 2: [[0, 1, 2], [1, 2,3]], 2: [[0, 1,2], [1, 2,3], 3: [1,2,3]}
不知道怎么做.多谢!
2005年11月20日 星期日 23:09
Shi Mu wrote:
> 以下
> 是一个dictionary:
>
> .>>>d
>
> {0: [[0, 1], [0, 2]], 1: [[0, 1], [1, 2], [1, 3]], 2: [[0, 2], [1, 2],
> [2, 3]], 3: [[1, 3], [2, 3]]}
> 在第一个KEY后,发现1和
> 2在其它地方有在一起,所以把1,2放在一起,否则就不考虑.
> 设计一个dictionary,
> 想让dicTry=
> {0: [[0, 1,2], 2: [[0, 1, 2], [1, 2,3]], 2: [[0, 1,2], [1, 2,3], 3: [1,2,3]}
> 不知道怎么做.多谢!
...没看明白-_-b
--
Qiangning Hong, Registered Linux User #396996
My Blog: http://www.hn.org/hongqn
RSS: http://feeds.feedburner.com/hongqn
2005年11月20日 星期日 23:10
d is a dictionary.
>>> d
{0: [[0, 1], [0, 2]], 1: [[0, 1], [1, 2], [1, 3]], 2: [[0, 2], [1, 2],
[2, 3]], 3: [[1, 3], [2, 3]]}
for the value under each key, if the possible connection is in the
dictionary, for example, under key 0. 1 and 2 were found to have a
pair in some other places so [0,1,2]
hence, how to design a geographyonary,
想让dicTry=
{0: [[0, 1,2], 2: [[0, 1, 2], [1, 2,3]], 2: [[0, 1,2], [1, 2,3], 3: [1,2,3]}
so, How to get dicTry?
Thanks a lot!
2005年11月20日 星期日 23:28
Shi Mu wrote:
> d is a dictionary.
>
> .>>>d
>
> {0: [[0, 1], [0, 2]], 1: [[0, 1], [1, 2], [1, 3]], 2: [[0, 2], [1, 2],
> [2, 3]], 3: [[1, 3], [2, 3]]}
>
> for the value under each key, if the possible connection is in the
> dictionary, for example, under key 0. 1 and 2 were found to have a
> pair in some other places so [0,1,2]
> hence, how to design a geographyonary,
> 想让dicTry=
> {0: [[0, 1,2], 2: [[0, 1, 2], [1, 2,3]], 2: [[0, 1,2], [1, 2,3], 3: [1,2,3]}
> so, How to get dicTry?
> Thanks a lot!
更看不懂了 orz
--
Qiangning Hong, Registered Linux User #396996
My Blog: http://www.hn.org/hongqn
RSS: http://feeds.feedburner.com/hongqn
2005年11月21日 星期一 09:42
在 05-11-20,Shi Mu<samrobertsmith at gmail.com> 写道: > 想让dicTry= > {0: [[0, 1,2], 2: [[0, 1, 2], [1, 2,3]], 2: [[0, 1,2], [1, 2,3], 3: [1,2,3]} > so, How to get dicTry? > Thanks a lot! 什么规则呀?键值都重复了 关键是看不出有什么规律
2005年11月21日 星期一 09:58
键值重复了,不可能做到 在 05-11-21,Fat<fatbobman at gmail.com> 写道: > 在 05-11-20,Shi Mu<samrobertsmith at gmail.com> 写道: > > > 想让dicTry= > > {0: [[0, 1,2], 2: [[0, 1, 2], [1, 2,3]], 2: [[0, 1,2], [1, 2,3], 3: [1,2,3]} > > so, How to get dicTry? > > Thanks a lot! > > 什么规则呀?键值都重复了 > 关键是看不出有什么规律 > > _______________________________________________ > Python中文技术讨论邮件列表 > 发言: 发邮件到 python-chinese at lists.python.cn > 订阅: 发送 subscribe 到 python-chinese-request at lists.python.cn > 退订: 发送 unsubscribe 到 python-chinese-request at lists.python.cn > 详细说明: http://python.cn/mailman/listinfo/python-chinese > > -- 欢迎访问我的小站: http://www.2tuzi.com blog : http://blog.2tuzi.com
2005年11月21日 星期一 11:31
dicTry的句法无效 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20051121/8ba1ce90/attachment.html
Zeuux © 2025
京ICP备05028076号