[1,2,3]与[1,2,3]完全相同? [英] [1,2,3] exactly same as [1,2,3,] ?
问题描述
x = [1,2,3]
和
x = [1,2,3,]
是完全一样的吧?
我正在生成一些python数据,并且它不易出错
不处理最后一个元素特别是,但我希望是
确定我正在生成一个等效的数据结构。
很多TIA!
Mark
-
Mark Harrison
皮克斯动画工作室
x=[1,2,3]
and
x=[1,2,3,]
are exactly the same, right?
I''m generating some python data, and it''s less error prone
to not treat the last element specially, but I want to be
sure I''m generating an equivalent data structure.
Many TIA!
Mark
--
Mark Harrison
Pixar Animation Studios
推荐答案
mh@pixar.com 写道:
x = [1 ,2,3]
和
x = [1,2,3,]
完全相同,对吧?
x=[1,2,3]
and
x=[1,2,3,]
are exactly the same, right?
遇到这类问题时,我问翻译:
{{{
mac:~pmcnett
When confronted with this type of question, I ask the interpreter:
{{{
mac:~ pmcnett
python
Python 2.5.2(r252:60911,2008年2月22日,07:57:53)
[GCC 4.0.1(Apple Computer,Inc。build 5363)] on darwin
输入help,copyright,credit等。或许可证或欲获得更多信息。
python
Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53)
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>> [1,2,3] == [1,2, 3,]
>>[1,2,3] == [1,2,3,]
True
}}}
Paul
True
}}}
Paul
Paul McNett< p@ulmcnett.comwrote:
Paul McNett <p@ulmcnett.comwrote:
遇到这类问题时,我问翻译:
When confronted with this type of question, I ask the interpreter:
>> [1,2,3] == [1,2,3, ]
>>[1,2,3] == [1,2,3,]
True
True
我想这是一个非常权威的答案..谢谢!
-
Mark Harrison
皮克斯动画工作室
Well I guess that''s a pretty authoritative answer... thanks!
--
Mark Harrison
Pixar Animation Studios
这篇关于[1,2,3]与[1,2,3]完全相同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!