<!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">
<link rel=
"STYLESHEET" href=
"ref.css" type='text/css'
/>
<link rel=
"SHORTCUT ICON" href=
"../icons/pyfav.png" type=
"image/png" />
<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 name='aesop' content='information'
/>
<title>6. Simple statements
</title>
<div id='top-navigation-panel' xml:id='top-navigation-panel'
>
<table align=
"center" width=
"100%" cellpadding=
"0" cellspacing=
"2">
<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>
<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>
<!--End of Navigation Panel-->
<H1><A NAME=
"SECTION008000000000000000000"></A><A NAME=
"simple"></A>
<a id='l2h-
451' xml:id='l2h-
451'
></a>
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:
<div class=
"productions">
<td><a id='tok-simple_stmt' xml:id='tok-simple_stmt'
>simple_stmt
</a></td>
<td><a class='grammartoken'
href=
"exprstmts.html#tok-expression_stmt">expression_stmt
</a></td></tr>
<td><code>|
<a class='grammartoken'
href=
"assert.html#tok-assert_stmt">assert_stmt
</a></code></td></tr>
<td><code>|
<a class='grammartoken'
href=
"assignment.html#tok-assignment_stmt">assignment_stmt
</a></code></td></tr>
<td><code>|
<a class='grammartoken'
href=
"augassign.html#tok-augmented_assignment_stmt">augmented_assignment_stmt
</a></code></td></tr>
<td><code>|
<a class='grammartoken'
href=
"pass.html#tok-pass_stmt">pass_stmt
</a></code></td></tr>
<td><code>|
<a class='grammartoken'
href=
"del.html#tok-del_stmt">del_stmt
</a></code></td></tr>
<td><code>|
<a class='grammartoken'
href=
"print.html#tok-print_stmt">print_stmt
</a></code></td></tr>
<td><code>|
<a class='grammartoken'
href=
"return.html#tok-return_stmt">return_stmt
</a></code></td></tr>
<td><code>|
<a class='grammartoken'
href=
"yield.html#tok-yield_stmt">yield_stmt
</a></code></td></tr>
<td><code>|
<a class='grammartoken'
href=
"raise.html#tok-raise_stmt">raise_stmt
</a></code></td></tr>
<td><code>|
<a class='grammartoken'
href=
"break.html#tok-break_stmt">break_stmt
</a></code></td></tr>
<td><code>|
<a class='grammartoken'
href=
"continue.html#tok-continue_stmt">continue_stmt
</a></code></td></tr>
<td><code>|
<a class='grammartoken'
href=
"import.html#tok-import_stmt">import_stmt
</a></code></td></tr>
<td><code>|
<a class='grammartoken'
href=
"global.html#tok-global_stmt">global_stmt
</a></code></td></tr>
<td><code>|
<a class='grammartoken'
href=
"exec.html#tok-exec_stmt">exec_stmt
</a></code></td></tr>
<a class=
"grammar-footer"
href=
"grammar.txt" type=
"text/plain"
>Download entire grammar as text.
</a>
<p><br /></p><hr class='online-navigation'
/>
<div class='online-navigation'
>
<!--Table of Child-Links-->
<A NAME=
"CHILD_LINKS"><STRONG>Subsections
</STRONG></a>
<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>
<LI><A href=
"augassign.html">6.3.1 Augmented assignment statements
</a>
<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>
<LI><A href=
"future.html">6.12.1 Future statements
</a>
<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>
<!--End of Table of Child-Links-->
<div class='online-navigation'
>
<table align=
"center" width=
"100%" cellpadding=
"0" cellspacing=
"2">
<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>
<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>
<span class=
"release-info">Release
2.4.2, documentation updated on
28 September
2005.
</span>
<!--End of Navigation Panel-->
See
<i><a href=
"about.html">About this document...
</a></i> for information on suggesting changes.