Data Handling Class 11
Data Handling Class 11
o Example: x = 10
o Example: y = 3.14
3. Complex (complex): Represents complex numbers with real and imaginary parts.
o Example: z = 2 + 3j
o Example: t = (1, 2, 3)
o Example: s = {1, 2, 3}
o Example: x = None
o Immutable: If the data is changed in the variable and its object ID is also changed
then it is an immutable datatype (e.g., integers, strings, tuples).
Type casting: -
Type conversion is the process of changing the data type of a value in programming.
Explicit conversion
The programmer manually performs this conversion, also known as type casting, when the compiler
requires it to avoid losing information. For example, in C, the programmer can place the type in
parentheses in front of the value.
for example –