Operators Assignment
The Output of a = 2+3-4/2**2 and also tell its type?
4 and int
4.0 and float
1.0 and float
5 and int
2. The output of the following python code snippet print(type(4/2)) print(type(4//2))
float and float
float and int
int and float
int and int
What will be the output of the following python code snippet a= 12 print(type(a)) a=’12345’ print(type(a))
a. Int and str b. Int and int c. str and int d. str and str
In which manner are operators with the same precedence evaluated?
a. Left to right b. Right to left c. Can’t say d. None of the Above Mentioned
Output of a = 2*3/4**1==2.00
a. 1.5 b. 2 c. True d. False
Output of the following print(100>2 and 100 > 30)
a. True b. False c. 100 d. 30
What will be the output of the following code print(True or True and False)
a. True b. False
What will be the precedence of
a. Not b. And c. Or
a. Abc b. Bac c. Bca d. Cab
The Output of the following 2/2*3**2<=10
a. True b. False c. 9 d. 10
type(22%3) = ?
a. Int b. Str c. Float d. Can’t say
Which will give an error?
a. A++ b. ++a c. A += 1 d. Both A and B
Suppose, there are 5 rupees in your pocket.
I am giving you 17 Rs. How many rupees do you have now?
Now I am giving you 39 Rs. How many rupees do you have now?
Now I am taking 23 Rs. back. How many rupees do you have now?
Again I am giving you 932 Rs. How many rupees do you have now?
Calculate the value of ( a ) in the expression: a =( 5 + 3 - 2 / 2 ).
Calculate the value of ( b ) in the expression: b = ((8 - 2) * 3 / 2 )
Calculate the value of ( c ) in the expression: c =( 10 / 2 + 3 * 4 )
Calculate the value of ( d ) in the expression: d =( 7 + 3 * (2 ** 2) - 5 )
Calculate the value of ( e ) in the expression: e =( (6 / 3) + (8 - 4) )
Calculate the value of ( f ) in the expression: f = (5 * (3 + 2) - 8 / 4 )
Calculate the value of ( g ) in the expression: g =( 12 / 4 + 7 - 3 * 2 )
Calculate the value of ( h ) in the expression: h = (9 - 3 + 4 * (2 ** 2) )
Suppose, you have 150 rupees.
You have 200 rupees.
Last updated