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

📄 30.html

📁 Python Ebook Python&XML
💻 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 Developer's Handbook -&gt; Control Statements</TITLE>
<LINK REL="stylesheet" HREF="oreillyi/oreillyN.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="8.html" class="navtitle">Web Development</a> &gt; <a href="0672319942.html" class="navtitle">Python Developer's Handbook</a> &gt; <a href="22.html" class="navtitle">2. Language Review</a> &gt; <span class="nonavtitle">Control Statements</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="29.html" title="Expressions"><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=0672319942&snode=30" target="_blank" title="Make a public or private annnotation">Make Note</a> | <a href="30.html" title="Use a Safari bookmark to remember this section">Bookmark</a></font></td><td align=right width="15%" class="headingsubbarbg"><a href="31.html" title="Data Structures"><font size="1">CONTINUE&nbsp;&gt;</font></a></td></TR></TABLE>
<a href="5%2F31%2F2002+4%3A19%3A29+PM.html" TABINDEX="-1"><img src=images/spacer.gif border=0 width=1 height=1></a><font color=white size=1>152015024128143245168232148039199167010047123209178152124239215162145080038237082193198183</font><a href="read0.asp?bookname=0672319942&snode=30&now=5%2F31%2F2002+4%3A19%3A29+PM" TABINDEX="-1"><img src=images/spacer.gif border=0 width=1 height=1></a><br>
<FONT>
				<h3>
			
			Control Statements</h3>
				<p>Python implements all the necessary types of control statements that your program might require. The syntax provided by Python's <tT CLAss="monofont">if, for,</tt> and <TT CLass="monofont">while</tT> statements should be enough for your needs.</P>

				<DIv class="note"><p class="notetitle"><b>Tip</b></p><p>

					<p>Remember to type a colon at the end of each line where you enter a statement declaration.</p>

				</p></dIv>
<bR>
<br>

				
					<h4>
						<Tt claSs="monofont">if/elif/else</tt>
					</H4>
					<P>The general <A Name="idx1073742398"></a>syntax for the <TT CLass="monofont">if/elif/else</tT> statement is as follows:</P>

					<PRe>
						
1: if &lt;<i>condition</i>&gt;:
2:     &lt;<i>statements</I>&gt;
3: [elif &lt;<I>condition</I>&gt;:
4:     &lt;<I>statements</i>&gt;]
5: [elif &lt;<i>condition</i>&gt;:
6:     pass]
7: 

⌨️ 快捷键说明

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