<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <link rel="STYLESHEET" href="ref.css" type='text/css' /> <link rel="SHORTCUT ICON" href="../icons/pyfav.gif" /> <link rel='start' href='../index.html' title='Python Documentation Index' /> <link rel="first" href="ref.html" title='Python Reference Manual' /> <link rel='contents' href='contents.html' title="Contents" /> <link rel='index' href='genindex.html' title='Index' /> <link rel='last' href='about.html' title='About this document...' /> <link rel='help' href='about.html' title='About this document...' /> <LINK rel="next" href="compound.html"> <LINK rel="prev" href="expressions.html"> <LINK rel="parent" href="ref.html"> <LINK rel="next" href="exprstmts.html"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name='aesop' content='information' /> <META name="description" content=". Simple statements "> <META name="keywords" content="ref"> <META name="resource-type" content="document"> <META name="distribution" content="global"> <title>6. Simple statements </title> </head> <body> <DIV CLASS="navigation"> <div id='top-navigation-panel'> <table align="center" width="100%" cellpadding="0" cellspacing="2"> <tr> <td class='online-navigation'><a rel="prev" title="5.14 Summary" href="summary.html"><img src='../icons/previous.png' border='0' height='32' alt='Previous Page' width='32' /></A></td> <td class='online-navigation'><a rel="parent" title="Python Reference Manual" href="ref.html"><img src='../icons/up.png' border='0' height='32' alt='Up One Level' width='32' /></A></td> <td class='online-navigation'><a rel="next" title="6.1 Expression statements" href="exprstmts.html"><img src='../icons/next.png' border='0' height='32' alt='Next Page' width='32' /></A></td> <td align="center" width="100%">Python Reference Manual</td> <td class='online-navigation'><a rel="contents" title="Table of Contents" href="contents.html"><img src='../icons/contents.png' border='0' height='32' alt='Contents' width='32' /></A></td> <td class='online-navigation'><img src='../icons/blank.png' border='0' height='32' alt='' width='32' /></td> <td class='online-navigation'><a rel="index" title="Index" href="genindex.html"><img src='../icons/index.png' border='0' height='32' alt='Index' width='32' /></A></td> </tr></table> <div class='online-navigation'> <b class="navlabel">Previous:</b> <a class="sectref" rel="prev" href="summary.html">5.14 Summary</A> <b class="navlabel">Up:</b> <a class="sectref" rel="parent" href="ref.html">Python Reference Manual</A> <b class="navlabel">Next:</b> <a class="sectref" rel="next" href="exprstmts.html">6.1 Expression statements</A> </div> <hr /></div> </DIV> <!--End of Navigation Panel--> <H1><A NAME="SECTION008000000000000000000"><!--x--></A><A NAME="simple"><!--z--></A> <BR> 6. Simple statements </H1> <a id='l2h-446'><!--x--></a> <P> Simple statements are comprised within a single logical line. Several simple statements may occur on a single line separated by semicolons. The syntax for simple statements is: <P> <dl><dd class="grammar"> <div class="productions"> <table cellpadding="2"> <tr valign="baseline"> <td><code><a id='tok-simple_stmt'>simple_stmt</a></code></td> <td> ::= </td> <td><code><a href="exprstmts.html#tok-expression_stmt">expression_stmt</a></code></td></tr> <tr valign="baseline"> <td> </td> <td> </td> <td><code>| <a href="assert.html#tok-assert_stmt">assert_stmt</a></code></td></tr> <tr valign="baseline"> <td> </td> <td> </td> <td><code>| <a href="assignment.html#tok-assignment_stmt">assignment_stmt</a></code></td></tr> <tr valign="baseline"> <td> </td> <td> </td> <td><code>| <a href="augassign.html#tok-augmented_assignment_stmt">augmented_assignment_stmt</a></code></td></tr> <tr valign="baseline"> <td> </td> <td> </td> <td><code>| <a href="pass.html#tok-pass_stmt">pass_stmt</a></code></td></tr> <tr valign="baseline"> <td> </td> <td> </td> <td><code>| <a href="del.html#tok-del_stmt">del_stmt</a></code></td></tr> <tr valign="baseline"> <td> </td> <td> </td> <td><code>| <a href="print.html#tok-print_stmt">print_stmt</a></code></td></tr> <tr valign="baseline"> <td> </td> <td> </td> <td><code>| <a href="return.html#tok-return_stmt">return_stmt</a></code></td></tr> <tr valign="baseline"> <td> </td> <td> </td> <td><code>| <a href="yield.html#tok-yield_stmt">yield_stmt</a></code></td></tr> <tr valign="baseline"> <td> </td> <td> </td> <td><code>| <a href="raise.html#tok-raise_stmt">raise_stmt</a></code></td></tr> <tr valign="baseline"> <td> </td> <td> </td> <td><code>| <a href="break.html#tok-break_stmt">break_stmt</a></code></td></tr> <tr valign="baseline"> <td> </td> <td> </td> <td><code>| <a href="continue.html#tok-continue_stmt">continue_stmt</a></code></td></tr> <tr valign="baseline"> <td> </td> <td> </td> <td><code>| <a href="import.html#tok-import_stmt">import_stmt</a></code></td></tr> <tr valign="baseline"> <td> </td> <td> </td> <td><code>| <a href="global.html#tok-global_stmt">global_stmt</a></code></td></tr> <tr valign="baseline"> <td> </td> <td> </td> <td><code>| <a href="exec.html#tok-exec_stmt">exec_stmt</a></code></td></tr> </table> </div> <a class="grammar-footer" href="grammar.txt" type="text/plain" >Download entire grammar as text.</a> </dd></dl> <P> <p><br /></p><hr class='online-navigation' /> <div class='online-navigation'> <!--Table of Child-Links--> <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></a> <UL CLASS="ChildLinks"> <LI><A href="exprstmts.html">6.1 Expression statements</a> <LI><A href="assert.html">6.2 Assert statements</a> <LI><A href="assignment.html">6.3 Assignment statements</a> <UL> <LI><A href="augassign.html">6.3.1 Augmented assignment statements</a> </ul> <LI><A href="pass.html">6.4 The <tt class="keyword">pass</tt> statement</a> <LI><A href="del.html">6.5 The <tt class="keyword">del</tt> statement</a> <LI><A href="print.html">6.6 The <tt class="keyword">print</tt> statement</a> <LI><A href="return.html">6.7 The <tt class="keyword">return</tt> statement</a> <LI><A href="yield.html">6.8 The <tt class="keyword">yield</tt> statement</a> <LI><A href="raise.html">6.9 The <tt class="keyword">raise</tt> statement</a> <LI><A href="break.html">6.10 The <tt class="keyword">break</tt> statement</a> <LI><A href="continue.html">6.11 The <tt class="keyword">continue</tt> statement</a> <LI><A href="import.html">6.12 The <tt class="keyword">import</tt> statement</a> <UL> <LI><A href="future.html">6.12.1 Future statements</a> </ul> <LI><A href="global.html">6.13 The <tt class="keyword">global</tt> statement</a> <LI><A href="exec.html">6.14 The <tt class="keyword">exec</tt> statement</a> </ul> <!--End of Table of Child-Links--> </div> <DIV CLASS="navigation"> <div class='online-navigation'><hr /> <table align="center" width="100%" cellpadding="0" cellspacing="2"> <tr> <td class='online-navigation'><a rel="prev" title="5.14 Summary" rel="prev" title="5.14 Summary" href="summary.html"><img src='../icons/previous.png' border='0' height='32' alt='Previous Page' width='32' /></A></td> <td class='online-navigation'><a rel="parent" title="Python Reference Manual" rel="parent" title="Python Reference Manual" href="ref.html"><img src='../icons/up.png' border='0' height='32' alt='Up One Level' width='32' /></A></td> <td class='online-navigation'><a rel="next" title="6.1 Expression statements" rel="next" title="6.1 Expression statements" href="exprstmts.html"><img src='../icons/next.png' border='0' height='32' alt='Next Page' width='32' /></A></td> <td align="center" width="100%">Python Reference Manual</td> <td class='online-navigation'><a rel="contents" title="Table of Contents" rel="contents" title="Table of Contents" href="contents.html"><img src='../icons/contents.png' border='0' height='32' alt='Contents' width='32' /></A></td> <td class='online-navigation'><img src='../icons/blank.png' border='0' height='32' alt='' width='32' /></td> <td class='online-navigation'><a rel="index" title="Index" rel="index" title="Index" href="genindex.html"><img src='../icons/index.png' border='0' height='32' alt='Index' width='32' /></A></td> </tr></table> <div class='online-navigation'> <b class="navlabel">Previous:</b> <a class="sectref" rel="prev" href="summary.html">5.14 Summary</A> <b class="navlabel">Up:</b> <a class="sectref" rel="parent" href="ref.html">Python Reference Manual</A> <b class="navlabel">Next:</b> <a class="sectref" rel="next" href="exprstmts.html">6.1 Expression statements</A> </div> </div> <hr /> <span class="release-info">Release 2.3.4, documentation updated on May 20, 2004.</span> </DIV> <!--End of Navigation Panel--> <ADDRESS> See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. </ADDRESS> </BODY> </HTML>