Language:EN
Pages: 2
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Page 1 Preview
each section lists the statements syntax formats

Each section lists the statements syntax formats

Creation
User-defined names are created by assignment but must exist when referenced (e.g., counters must be explicitly initialized to zero). See the section “Namespace and Scope Rules” on page 82.

Table 12. Python 3.0 reserved words

finally

None

continue

for

from

nonlocal

while

global

as

elif

assert
import

pass

break

In Python 2.6, print and exec are both reserved words, as they take the form of statements, not built-in func-tions. Also in Python 2.6, nonlocal, True, and False are not reserved words; the first of these is unavailable, and the latter two are simply built-in names. with and as are reserved in both 2.6 and 3.0, but not in earlier 2.X re-leases unless context managers are explicitly enabled. yield is reserved as of 2.3; it morphed from statement to expression later but is still a reserved word.

Name conventions

• Names beginning but not ending with two underscores (e.g., __X) within a class statement are prefixed with the enclosing class’s name (see “Pseudoprivate Attrib- utes” on page 86).

• The name that is just a single underscore (_) is used in the interactive interpreter (only) to store the result of the last evaluation.

The following sections describe all Python statements. Each section lists the statement’s syntax formats, followed by usage details. For compound statements, each appearance of a suite in a statement format stands for one or more other statements, possibly indented as a block under a header line. A suite must be indented under a header if it contains another compound statement (if, while, etc.); otherwise, it can appear on the same line as the statement header. The following are both valid constructs:

if x < 42:
print(x)
while x: x = x − 1

You are viewing 1/3rd of the document.Purchase the document to get full access instantly

Immediately available after payment
Both online and downloadable
No strings attached
How It Works
Login account
Login Your Account
Place in cart
Add to Cart
send in the money
Make payment
Document download
Download File
img

Uploaded by : Jay Bailey

PageId: DOC34133F3