Professional Documents
Culture Documents
Grade XI
Informatics Practices
Block 4: Data Handling
Precedence of Operators
Note:
Parenthesis can be used to override the precedence of
operators. The expression within () is evaluated first.
For operators with equal precedence, the expression is
evaluated from left to right.
ID and TYPE
The built-in function id() returns the identity of an object as
an integer. This integer usually corresponds to the object’s
location in memory, although this is specific to the Python
implementation and the platform being used. The is operator
compares the identity of two objects.
Mutable objects:
Immutable objects:
if we do a simple operation.
x=x+1
Now
id(x) != id(y)id(x) != id(10)
Now poping an item from list object does change the object,
m.pop()
Type Casting
Explicit type conversion is known as Type casting.
Syntax : <datatype> (expression)
int(a)
Debugging:
Debugging means to remove bugs(error) from a program.
Debugging refers to the process of locating the place of error,
cause of error, and correcting the code accordingly.
There are types of errors:
1. Compile time error – Errors that occurs during complie-
time, are compile time errors. When a program compiles, its
source code is checked for whether it follows the
programming language’s rules or not.
a. Syntax Error – when rules of a programming language
are misused.
Eg: if x =(x*y)