Python

38
1304 reads

January 31, 2013

Create Strings


We can create them simply by enclosing characters in quotes. Python treats single quotes ( ' ' ) the same as double quotes( " " ).

21
1302 reads

January 30, 2013

40
1316 reads

January 30, 2013

Removing From Lists In Python


Delete List Elements:
To remove a list element, we can use either the "del" statement if we know exactly which element(s) we are deleting or the remove( ) method or the pop( ) method.

38
1341 reads

January 30, 2013

Creating Lists In Python


Creating lists:
A list can be created by defining it within [ ].
A numbered list can also be created with the "range function" which takes start and stop values and an increment.

37
1388 reads

January 30, 2013

Python Lists


Arrays in Python are actually LISTS that can contain mixed datatypes.

45
1420 reads

January 29, 2013

Python Comparison Operators


Comparison operators return Boolean values, that is, True or False.
The following comparison operators are supported by Python language
== - equal
!= - not equal (read as Bang equal)

47
1267 reads

January 29, 2013

Python Operators Precedence


Operator precedence determines the grouping of terms in an expression. This affects how an expression is evaluated.

45
1685 reads

January 29, 2013

Python Bitwise Operators


Bitwise operator works on bits and perform bit by bit operation.The following Bitwise operators are supported by Python language:
& - Binary AND
| - Binary OR
^ - Binary XOR

58
1409 reads

January 29, 2013

Python Arithmetic Operators


What is an operator?
Simple answer can be given using expression 4 + 5 is equal to 9. Here 4 and 5 are called operands and + is called operator.

70
5127 reads

January 28, 2013

Python Variable Naming Rules


Python Variable Naming Rules:

1.Must begin with a letter (a - z, A - B) or underscore (_).

2.Other characters can be letters, numbers or _ only.

3.Variable names are Case Sensitive.