Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python关键字角色_Python_Keyword - Fatal编程技术网

Python关键字角色

Python关键字角色,python,keyword,Python,Keyword,我在web上查找了所有Python关键字的列表以及它们的作用,但是我只能找到关键字列表,而没有解释它们的作用。示例:。所以基本上,如果我想知道一个关键词是什么,我必须在网上寻找它。虽然这不是什么麻烦事,但我相信一定有一个来源,所有这些信息都已被分组,加快了关键字学习过程 因此,我想知道这里是否有人可以推荐我到一个网站,在那里我可以找到所有这些信息 谢谢 介绍了Python语言及其关键字。它从基本到高级解释了对初学者有用的语言(例如,从基本的if和else到更高级的lambda和yield)。奇怪

我在web上查找了所有Python关键字的列表以及它们的作用,但是我只能找到关键字列表,而没有解释它们的作用。示例:。所以基本上,如果我想知道一个关键词是什么,我必须在网上寻找它。虽然这不是什么麻烦事,但我相信一定有一个来源,所有这些信息都已被分组,加快了关键字学习过程

因此,我想知道这里是否有人可以推荐我到一个网站,在那里我可以找到所有这些信息


谢谢

介绍了Python语言及其关键字。它从基本到高级解释了对初学者有用的语言(例如,从基本的
if
else
到更高级的
lambda
yield
)。

奇怪的是,它是在谷歌搜索上的。

讨论了Python的结构和语法。所有这些关键字都在这里的某个地方进行了讨论,只需查看目录,尽管不是全部收集到一个列表中

根据您的Python发行版是否安装了文档,您可以通过Python解释器中的交互式帮助菜单直接访问关键字信息:

>>> help() Welcome to Python 2.7! This is the online help utility. ... To get a list of available modules, keywords, or topics, type "modules", "keywords", or "topics". Each module also comes with a one-line summary of what it does; to list the modules whose summaries contain a given word such as "spam", type "modules spam". help> keywords Here is a list of the Python keywords. Enter any keyword to get more help. and elif if print as else import raise assert except in return break exec is try class finally lambda while continue for not with def from or yield del global pass help> and Boolean operations ****************** ... The expression ``x and y`` first evaluates *x*; if *x* is false, its value is returned; otherwise, *y* is evaluated and the resulting value is returned. >>>帮助() 欢迎使用Python 2.7!这是联机帮助实用程序。 ... 要获取可用模块、关键字或主题的列表,请键入“模块”, “关键词”或“主题”。每个模块还附带一行摘要 它的作用;列出其摘要包含给定单词的模块 例如“垃圾邮件”,键入“模块垃圾邮件”。 帮助>关键字 下面是Python关键字的列表。输入任何关键字以获取更多帮助。 如果打印 正如其他进口产品一样 除非作为回报而断言 break exec正在尝试 班上终于有了lambda 继续,不要用 从或屈服 全球通行证 帮助>和 布尔运算 ****************** ... 表达式``x和y``首先计算*x*;如果*x*为false,则其 返回值;否则,将计算*y*,并计算结果值 返回。在提示符中:


请通读一下文档。是否有理由限制您使用Python2.3?您正在阅读7年前的文档。Python从那以后发生了很大的变化。我猜你可能找不到你想要的东西,因为你学习这种语言的方法不是大多数人都是这样做的——因此对这种东西的需求很少。我认为这是一个评论,而不是一个答案。@senderle我认为恰恰相反。它准确地回答了这个问题。通过仔细查看网站,它确实有我想要的东西。网站的布局让我第一次上它时就跑掉了。谢谢:)@senderle我同意。虽然问题在于问题本身。 >>> help() [OMITTED LINES FOR BREVITY] To get a list of available modules, keywords, or topics, type "modules", "keywords", or "topics". Each module also comes with a one-line summary of what it does; to list the modules whose summaries contain a given word such as "spam", type "modules spam". help> keywords Here is a list of the Python keywords. Enter any keyword to get more help. and elif if print as else import raise assert except in return break exec is try class finally lambda while continue for not with def from or yield del global pass help>
>>> from keyword import kwlist, iskeyword
>>> kwlist
['and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 
'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', 'import', 
'in', 'is', 'lambda', 'not', 'or', 'pass', 'print', 'raise', 'return', 'try', 
'while', 'with', 'yield']
>>> iskeyword("and")
True