Professional Documents
Culture Documents
A.lab 02
A.lab 02
LAB#02
Objective:
Implement type of data types, variables and operators used
in python.
EXERCISE:
A. Point out the errors, if any also paste the output in the
following python statement.
1.X=5:
print(x)
Errors:
:
Code:
X=5
Print(x)
Output:
2. 1TEXT = “SSUET”
NUMBER = 1
print(NUMBER+ TEXT)
Errors:
1Text(variables should be start from non numeric)
Number =1(it should be converted into string)
Code:
TEXT = “SSUET”
NUMBER = str(1)
print(NUMBER+ TEXT)
Output:
3. a = b = 3 = 4
Errors:
a = b = 3 = 4
Code:
a,b=3,4
print(a)
print(b)
Output:
B. Evaluate the operation in each of the following
statements, and show resultant value after each statement
is executed.
1. a = 2 % 2 + 2 * 2 – 2 / 2;
RESULTANT VALUE:
2. b = 3 / 2 + 5 * 4 / 3;
RESULTANT VALUE:
3. c = b = a = 3 + 4;
RESULTANT VALUE: