case / switch语句? [英] case/switch statement?
问题描述
大家好,
我浏览了Python的文档,我没有找到像
一样的case或switch语句。我假设有一个,我只是错过了b $ b错过了它。有人可以请我指出相应的文件,或者
发布一个例子吗?我不喜欢这个想法特别长 - 如果 - 其他
陈述。
乔
Hi all,
I skimmed through the docs for Python, and I did not find anything like
a case or switch statement. I assume there is one and that I just
missed it. Can someone please point me to the appropriate document, or
post an example? I don''t relish the idea especially long if-else
statements.
Joe
推荐答案
Joe Stevenson写道:
Joe Stevenson wrote:
大家好,
我浏览了Python的文档,但我找不到像<案例或开关声明。我假设有一个,我只是错过了它。
严格来说,python没有
有一个开关stamenent。
为什么不是在Python中有一个switch或case语句?"
< http://www.python.org/doc/faq/general.html#why-isn-t-there-a-switch -or-case-statement-in-python>
有人可以请我指出相应的文件,或者
发布一个例子吗?我不喜欢这个想法特别长 - 如果 - 其他
声明。
Hi all,
I skimmed through the docs for Python, and I did not find anything like
a case or switch statement. I assume there is one and that I just
missed it.
strictly speaking, python does not
have a switch stamenent.
"Why isn''t there a switch or case statement in Python?"
<http://www.python.org/doc/faq/general.html#why-isn-t-there-a-switch-or-case-statement-in-python>
Can someone please point me to the appropriate document, or
post an example? I don''t relish the idea especially long if-else
statements.
主题已经被打死,感觉
免费浏览群组档案:
< http://groups-beta.google.com/groups?q = comp.lang.python + switch + statement>
>
HTH。
-
deelan< http://www.deelan.com>
topic already beated to death, feel
free to browse the group archives:
<http://groups-beta.google.com/groups?q=comp.lang.python+switch+statement>
HTH.
--
deelan <http://www.deelan.com>
Joe Stevenson写道:
Joe Stevenson wrote:
我浏览了Python的文档,我没有找到像
一样的case或switch语句。我假设有一个,我只是错过了它。有人可以请我指出相应的文件,或者发表一个例子吗?我不喜欢这个想法特别长 - 如果 - 其他
声明。
I skimmed through the docs for Python, and I did not find anything like
a case or switch statement. I assume there is one and that I just
missed it. Can someone please point me to the appropriate document, or
post an example? I don''t relish the idea especially long if-else
statements.
如果你真的想要一个,你可以使用
< http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/410692>。
If you really want one, you could use
<http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/410692>.
我_love_ Python!
Leif K-Brooks写道:
I _love_ Python!
Leif K-Brooks wrote:
Joe Stevenson写道:
Joe Stevenson wrote:
我浏览了Python的文档,我没有找到像
案例或开关声明。我假设有一个,我只是错过了它。有人可以请我指出相应的文件,或者发表一个例子吗?我不喜欢这个想法,特别是如果 - 其他
声明。
I skimmed through the docs for Python, and I did not find anything like
a case or switch statement. I assume there is one and that I just
missed it. Can someone please point me to the appropriate document, or
post an example? I don''t relish the idea especially long if-else
statements.
如果你真的想要一个,你可以使用
< http:// aspn.activestate.com/ASPN/Cookbook/Python/Recipe/410692>。
If you really want one, you could use
<http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/410692>.
这篇关于case / switch语句?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!