Mega Code Archive
Search
.Net
ASP .Net
ASP .Net Tutorial
C#
C# Book
C# by API
C# Tutorial
VB.Net
VB.Net by API
VB.Net Tutorial
Visual C++ .Net
VisualBasic Script
Java
Java
Java Book
Java by API
Java Tutorial
Script
Flash ActionScript
Flex
JavaScript DHTML
JavaScript Reference
JavaScript Tutorial
Database
MSSQL
MSSQL Tutorial
MySQL
MySQL Tutorial
Oracle PLSQL
Oracle PLSQL Tutorial
PostgreSQL
Languages
Android
C
C Tutorial
C++
C++ Tutorial
Delphi
Perl
PHP
Python
Python Tutorial
Ruby
Silverlight
Office
MSOfficeExcel 2007 Tutorial
MSOfficePowerPoint 2007 Tutorial
MSOfficeWord 2007 Tutorial
Data
XML
XML Tutorial
Python Tutorial
Statement 114 codes
Home
Python Tutorial
Statement
1 A dictionary-based switch
2 A Real Catch all
3 A Recursive Generator
4 A typical if statement with all three kinds of clauses
5 Analysis of examination results
6 AssertionError
7 Assertions
8 AttributeError
9 Blank except Clauses
10 Break and continue Statements, and Else Clauses on Loops
11 Break from for loop
12 Break out of a while loop
13 Break Statement
14 Breaking Out of Loops
15 Calculating compound interest
16 Catch Keyboard interrupt exception
17 Catch KeyError and AssertionError
18 Catch more than on exceptions
19 Catching Exceptions
20 Catching Exceptions with try except
21 Catching the Object
22 Catching Two Exceptions
23 Catching Two Exceptions with One Block
24 Check whether a condition is true and raises an AssertionError (optionally with a supplied error message) if it isnt
25 Class average program with sentinel-controlled repetiton
26 Continue Statement
27 Counter-controlled repetition
28 Counter-controlled repetition with the for structure and range function
29 Counting Loops
30 Creating MultiLine Statements
31 Cross-Product Pairs Example
32 Defining Clean-Up Actions
33 Demonstrating a programmer-defined exception class
34 Demonstrating exception arguments and stack unwinding
35 Elif Clauses
36 Else Clauses
37 Else Statement Take Two
38 Except Statement with Multiple Exceptions
39 Except two exceptions
40 Exception Arguments
41 Exception Classes
42 Exceptions Can Be Classes
43 Expressions and statements can span several lines
44 Fibonacci sequences using generators
45 Flatten generator rewritten as a plain function
46 For Loop and the range() Built-in Function
47 For Loops
48 Generator Expressions
49 Generator expressions and buildin functions
50 Generator expressions return a generator object, which in turn supports the iteration protocol to yield one piece of the result
51 Generator Function Example
52 Get an exceptions argument
53 Have a block of code that is executed unless something bad happens
54 If Statement
55 Import module vs from module import
56 Importing Something As Something Else
57 IndexError
58 IOError
59 Iterating List with for Loops
60 Iterating Through a Dictionary
61 KeyError
62 Making a Generator
63 Making It Safer
64 Manually iterating through a generator (or an iterator for that matter)
65 Modules can be imported directly using the package or module name
66 Multiple except Clauses
67 Namespace should be named something different
68 Nested for loops
69 Nesting Blocks
70 Nothing Happened
71 Pass Statement
72 Printing a line of text in Python
73 Printing a line with multiple statements
74 Printing multiple lines with a single statement
75 Raise error from function
76 Raise exception-type
77 Raise Statement
78 Raise value error
79 Raise ZeroDivisionError
80 Replace our single error string with the string representation of the exception argument
81 Simple exception handling example
82 Simple Generator Features
83 String-Based Exceptions
84 Summation with for
85 The Class Namespace
86 The del statement unbinds variables and attributes, and removes parts (positions, slices, or slots) from data structures (mappin
87 The else Clauses
88 The finally clause will execute, whether there was an error encountered or not
89 The if statement is used for conditional execution, and it may include elif and else clauses
90 The while Statement
91 To import only one function with a given name
92 Traceback object can print out information about the exception
93 Try statement encloses pieces of code where one or more known exceptions may occur
94 Try Statement with Multiple excepts
95 Tryexcept block that checks for correct user input
96 Tryexcept block with string argument
97 Try-except Statement
98 Try-finally Statement
99 Use a loop to ensure that the user enters a name
100 Use any of the for loop, map, or list comprehension techniques
101 Use break to stop execution and break out of the current loop
102 Use if statement to compare string
103 Using an if-else statement
104 Using finally clauses
105 Using if statements, relational operators and equality operators to show improper indentation
106 Using the break statement in a for structure
107 Using the break statement to avoid repeating code in the class-average program
108 Using the continue statement in a forin structure
109 While and else
110 While loop with counter
111 While Loops
112 With the def statement
113 Working with the Exception Information
114 ZeroDivisionError