CLASS-XI-TEST ON PYTHON FUNDAMENTALS
1. What is the output of this expression, 3*1**3?
a. 27 b. 9 c. 3 d. 1
2. Which of the following statements assigns the value 25 to the variable x in Python:
a. x==25 b. x:=25 c. 25=x d. x=25
3. In the Python statement x = a +c – b
a, c and b are ________
a + c - b is ________
a. terms, a group b. operators, a statement c. operands, expression d. None of the above
4. What is the output of following assignment operator?
a=10
a%=4
print(a)
a. 10 b. 2 c. 4 d. 0
5. What is the order of precedence in python?
i) Parentheses iii) Multiplication v) Addition
ii) Exponential iv) Division vi) Subtraction
a. ii,i,iii,iv,v,vi b. ii,i,iv,iii,v,vi c. i,ii,iii,iv,v,vi d. i,ii,iii,v,iv,vi
6. Operators with the same precedence are evaluated in which manner (except **)
a. Left to right b. Right to left c. can’t say d. None of the above
7. ----------------- are named labels, whose values can be used and processed at runtime
a. Token b. Keyword c. Identifier d. variable
8. Which of the following is valid variable name?
a. stu_age b. stu-age c. stu age d. 5stuage
9. Which of the following is equivalent decimal number for 1001011
a. 74 b. 65 c. 75 d. 76
10. ----------------function refers to the objects address in the memory
a. address() b. memory() c. object() d. id()
11. Identify the type of operator:
a. ^ :
b. and :
c. ** :
d. is not :
e. in :
f. = :
g. <= :
h. //= :
12. Predict the output for the following expressions:
a,b,c,d=35,24,2, 'python'
a. print(a or b) :
b. print(b and c) :
c. print(a>=c) :
d. print(a & c) :
e. print(a ^ b) :
f. print(((a+c)<b )and ((b//c)==a)) :
g. print('o' in d) :
h. print(a is b) :
13. Identify which of the following variable declarations are raised an error (valid or invalid)?
a. a,b=5,6,7 :
b. abc=5,6,9 :
c. a,b,c=2,7,8 :
d. a,b,c=5 :
e. a=b=c=5 :
f. x= 'python'
print(x/2) :
g. x=10
print(x/2) :
h. a+b=c :
14. Predict the output of the following:
a. x,y,z=4,5,6
y,z,x=x+3,y-6,z*2
print(x,y,z) :
b. a,b=4,6.7
print(type(a)) :
print(type(b)) :
c. x,y=20,60
y,x,y=x,y-10,x+10
print(x,y) :
d. name='kiran'
class=11
print(name, 'is studying', class, 'th') :
e. print(50//5/2%3*10) :
15. The following questions contain two statements: ASSERTION and REASONING. Each question has four choices
i, ii, iii, iv choices – only one of which is correct. In the light of these statements, choose the most appropriate
option
i. Both A and R are true and R is the correct explanation of A
ii. Both A and R are true and R is the not correct explanation of A
iii. A is true but R is false
iv. A is false but R is true
a. Assertion(A): Python allows multiple assignments
Reasoning(R): It means that, one or more variables can be assigned the same or different value
simultaneously using single statement.
(i) (ii) (iii) (iv)
b. Assertion(A): In python, the presence of an element in a sequence can be checked by using membership
operator.
Reasoning(R): you use, ‘is’ and ‘is not’ operators to check to check the element present in the sequence or
not.
(i) (ii) (iii) (iv)
c. Assertion(A): Bitwise operators are used to compare two numbers.
Reasoning(R): == and = are works differently.
(i) (ii) (iii) (iv)