⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 29.html

📁 国外python经典教材,python爱好者的首选
💻 HTML
字号:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Robots" content="INDEX,NOFOLLOW">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<TITLE>Safari | Python Essential Reference, Second Edition -&gt; Identifiers and Reserved Words</TITLE>
<LINK REL="stylesheet" HREF="oreillyi/oreillyM.css">
</HEAD>
<BODY bgcolor="white" text="black" link="#990000" vlink="#990000" alink="#990000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<table width="100%" cellpadding=5 cellspacing=0 border=0 class="navtopbg"><tr><td><font size="1"><p class="navtitle"><a href="2.html" class="navtitle">Linux/Unix</a> &gt; <a href="0735710910.html" class="navtitle">Python Essential Reference, Second Edition</a> &gt; <a href="26.html" class="navtitle">2. Lexical Conventions and Syntax</a> &gt; <span class="nonavtitle">Identifiers and Reserved Words</span></p></font></td><td align="right" valign="top" nowrap><font size="1"><a href="main.asp?list" class="safnavoff">See All Titles</a></font></td></tr></table>
<TABLE width=100% bgcolor=white border=0 cellspacing=0 cellpadding=5><TR><TD>
<TABLE border=0 width="100%" cellspacing=0 cellpadding=0><TR><td align=left width="15%" class="headingsubbarbg"><a href="28.html" title="Line Structure and Indentation"><font size="1">&lt;&nbsp;BACK</font></a></td><td align=center width="70%" class="headingsubbarbg"><font size="1"><a href="popanote.asp?pubui=oreilly&bookname=0735710910&snode=29" target="_blank" title="Make a public or private annnotation">Make Note</a> | <a href="29.html" title="Use a Safari bookmark to remember this section">Bookmark</a></font></td><td align=right width="15%" class="headingsubbarbg"><a href="30.html" title="Literals"><font size="1">CONTINUE&nbsp;&gt;</font></a></td></TR></TABLE>
<a href="5%2F28%2F2002+8%3A53%3A01+PM.html" TABINDEX="-1"><img src=images/spacer.gif border=0 width=1 height=1></a><font color=white size=1>155117184014003188065099048180054212144238241179195140058238110137104027027050077005253035</font><a href="read5.asp?bookname=0735710910&snode=29&now=5%2F28%2F2002+8%3A53%3A01+PM" TABINDEX="-1"><img src=images/spacer.gif border=0 width=1 height=1></a><br>
<FONT>
<h3>Identifiers and Reserved Words</h3>
<p>An <i>identifier</I> is a name used to identify variables, functions, classes, modules, and other objects. Identifiers can include letters, numbers, and the underscore character (<TT Class="monofont">_</TT>  ), but must always start with a non-numeric character. Letters are currently confined to the characters A朲 and a杬 in the ISO-Latin character set. Because identifiers are case sensitive, <TT clasS="monofont">FOO</TT>  is different from <Tt class="monofont">foo</tt>. Special symbols such as <tt class="monofont">$</tt>, <tt cLasS="monofont">%</tt>, and <tT clasS="monofont">@</tt> are not allowed in identifiers. In addition, words such as <tT CLAss="monofont">if</tt>, <TT CLass="monofont">else</tT>, and <TT Class="monofont">for</TT> are reserved and cannot be used as identifier names. The following list shows all the reserved words:</P>

<Pre>

and                 elif                global              or 
assert              else                if                  pass 
break               except              import              print 
class               exec                in                  raise 
continue            finally             is                  return 
def                 for                 lambda              try 
del                 from                not                 while </pre>

<p>Identifiers starting or ending with underscores often have special meanings. For example, identifiers starting with a single underscore such as <tt class="monofont">_foo</tt>  are not imported by the <tt claSs="monofont">from module import *</tT> statement. Identifiers with leading and trailing double underscores such as <tt cLass="monofont">_ _init_ _</tT> are reserved for special methods, and identifiers with leading double underscores such as <tt cLASS="monofont">_ _bar</tt> are used to implement private class members as described in <a hREF="72.html">Chapter 7</A>, 揅lasses and Object-Oriented Programming.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -