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
List 96 codes
Home
Python Tutorial
List
1 A step size of two will include only every other element of the interval between the start and the end
2 Accessing a List
3 Accessing items in sublists
4 Adding and Removing Items in a List
5 Adding Elements to a List
6 Adding Sequences
7 All items
8 Another parameter, which normally is left implicit, is the step length
9 Appending items to a list
10 Assigning to Slices
11 Changing Lists
12 Check a user name and PIN code
13 Compare the nested list objects
14 Compare two lists
15 Computed some Fibonacci numbers
16 Copy the entire sequence, you may leave out both indices
17 Create a list from a string
18 Creating a histogram from a list of values
19 Creating, accessing and changing a list
20 Creation of both homogeneous and heterogeneous lists
21 Defining a List
22 Deleting Elements
23 End slice
24 Extend with list
25 Extended List Comprehension Syntax
26 Filtering Lists
27 For each item in a list
28 Get max from a list
29 Get the length of a list
30 Get the min value from a list
31 If a function call returns a sequence, you can index it directly
32 If the slice continues to the end of the sequence, you may simply leave out the last index
33 If the slice continues to the start of the sequence, you may simply leave out the first index
34 If you want every fourth element of a sequence, you only have to supply a step size of four
35 Indexing
36 Insert item at index
37 Items of a list are separated by commas and enclosed in square brackets
38 Iterating by Sequence Index
39 Iterating by Sequence Item
40 Key sort
41 Len() provides the total number of elements in the tuple
42 LHS slice and the RHS may each be of any length
43 List Comprehension
44 List Comprehensions in build Connection String, Step by Step
45 List Operators
46 List Type Operators and List Comprehensions
47 Max() and min()
48 Membership ( in, not in )
49 Middle slice
50 Modifying a list
51 Multidimensional arrays
52 Multiplying a sequence by a number x creates a new sequence where the original sequence is repeated x times
53 Negative Indices
54 Negative List Indices
55 Negative step size
56 Nested list
57 Operators
58 Parallel Iteration
59 Pop item by index
60 Print out a date, given year, month, and day as numbers
61 Repetition ( )
62 Replace the slice with a sequence whose length is different from that of the original
63 Reverse list
64 Reverse sort
65 Revese and skip
66 Searching a List
67 Slice assignments can even be used to insert elements without replacing any of the original ones
68 Slice from the end
69 Slice more than what you have
70 Slicing a List
71 Slicing Shorthand
72 Slicing to access ranges of elements
73 Sort the elements according to their lengths
74 Sorting a List
75 Specific items
76 Student poll program
77 Sum() function
78 The append method is used to append an object to the end of a list
79 The Difference Between Extend and Append
80 The extend method appends several values at once by supplying a sequence of the values
81 The first is inclusive, and the second is exclusive
82 The index method is used for searching lists to find the index of the first occurrence of a value
83 The insert method is used to insert an object into a list
84 The list should be sorted in reverse
85 The pop method removes an element (by default the last one) from the list and returns it
86 The reverse method reverses the elements in the list
87 The sort method is used to sort lists in place
88 The starting and ending indices can exceed the length of the string
89 Use cmp() to compare lists
90 Use negative indices to access the list from the end rather than from the beginning
91 Uses a string as the sequence to create a list of characters in the string
92 Using List Comprehensions on Files
93 Using the enumerate()
94 When you use a negative index, Python counts from the right
95 You can delete an item or a slice from a list with del
96 You can do the reverse to delete a slice