Python

35
1384 reads

February 7, 2013

Working with Object Data


This example illustrates how to handle object data.

158
2148 reads

February 7, 2013

Constructors and Objects


This example shows the use of a constructor and how objects can call functions of the class and maintain their own copy of the class variable.

117
1358 reads

February 7, 2013

Defining Classes


This example demonstrates the definition of a class and how its functions are called.

197
2302 reads

February 7, 2013

Basic Tuples Operations


Tuples respond to the + and * operators much like strings; they mean concatenation and repetition here too, except that the result is a new tuple, not a string.

109
1179 reads

February 7, 2013

Accessing Values in Tuples


Like string indices, tuple indices start at 0, and tuples can be sliced, concatenated and so on.

229
2633 reads

February 7, 2013

Python-Creating Tuples


Creating a tuple is as simple as putting different comma-separated values and optionally we can put these comma-separated values between parentheses also.

388
2253 reads

February 7, 2013

Variable Arguments


This example illustrates how to receive an unknown number of parameters in a function.

27
1211 reads

February 7, 2013

Defining Functions


This example shows how functions are defined and called.

32
1289 reads

February 7, 2013

Types of functions


This example illustrates the 4 different types of functions and the use of default value for parameters.

84
1256 reads

February 7, 2013

reassign a value to a variable


A variable is something with a value that may change. Whenever declare variables or changing their values, always write the name of the variable on the left side of equal sign(the assignment