指某东西的用途 : [英] The use of :

查看:94
本文介绍了指某东西的用途 :的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有些陈述使用:尾部如x> 0:和def func():

在Python中是什么意思和用法?

解决方案

Chang LI写道:

有些陈述使用:在尾部如x> 0:和def func():
在Python中是什么意思和用法?




这意味着在缩进块中跟随其他内容部分相同的

声明。


-

Erik Max Francis&& ma*@alcyone.com && http://www.alcyone.com/max/

美国加利福尼亚州圣何塞市&& 37 20 N 121 53 W&& AIM erikmaxfrancis

感知是受苦。

- 亚里士多德


2004年11月25日星期四18: 58:16 -0800,Chang LI写道:

有些陈述使用:在尾部如x> 0:和def func():
在Python中是什么意思和用法?




它与缩进一起标识一个块代码大多数语言

使用终止关键字,如WEND等。 " ENDIF" "下一步]识别

一组指令的结尾,或者包括语法

,例如{} begin..end或



Some statements use : in the tail such as while x > 0: and def func():
What is the meaning and the usage of : in Python?

解决方案

Chang LI wrote:

Some statements use : in the tail such as while x > 0: and def func():
What is the meaning and the usage of : in Python?



It means something else follows in an indented block as part of the same
statement.

--
Erik Max Francis && ma*@alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
To perceive is to suffer.
-- Aristotle


On Thu, 25 Nov 2004 18:58:16 -0800, Chang LI wrote:

Some statements use : in the tail such as while x > 0: and def func():
What is the meaning and the usage of : in Python?



It, together with the indent, identifies a block of code. Most languages
use either a terminating keyword like "WEND" "ENDIF" "NEXT" to identify
the end of a group of instructions, or alternatively a bracketing syntax
such as {} begin..end or


(


这篇关于指某东西的用途 :的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆