1 MCQ Class 11th Variables
1 MCQ Class 11th Variables
: 9810301034
VARIABLE NAMES
1. Is Python case sensitive when dealing with identifiers?
a) Yes b) no c) Machine dependent d) none of the mentioned
2. What is the maximum possible length of an identifier?
a) 31 characters b) 63 characters c) 79 characters d) none of the mentioned
3. Which of the following is invalid?
a) _a = 1 b) __a = 1 c) __str__ = 1 d) none of the mentioned
4. Which of the following is an invalid variable?
a) my_string_1 b) 1st_string c) foo d) _
5. Why are local variable names beginning with an underscore discouraged?
a) they are used to indicate a private variables of a class b) they confuse the interpreter
c) they are used to indicate global variables d) they slow down execution
6. Which of the following is not a keyword?
a) eval b) assert c) nonlocal d) pass
7. All keywords in Python are in
a) lower case b) UPPER CASE c) Capitalized d) None of the mentioned
8. Which of the following is true for variable names in Python?
a) Unlimited length b) All private members must have leading and trailing underscores
c) Underscore and ampersand are the only two special characters allowed d) None of the mentioned
9. Which of the following is an invalid statement?
a) abc = 1,000,000 b) a b c = 1000 2000 3000 c) a,b,c = 1000, 2000, 3000 d) a_b_c = 1,000,000
10. Which of the following cannot be a variable?
a) __init__ b) in c) it d) on
BASIC OPERATORS
1. Which is the correct operator for power(xy)?
a) X^y b) X**y c) X^^y d) None of the mentioned
2. Which one of these is floor division?
a) / b) // c) % d) None of the mentioned
3. What is the order of precedence in python?
i) Parentheses ii) Exponential iii) Multiplication iv) Division v) Addition vi) Subtraction
a) i,ii,iii,iv,v,vi b) ii,i,iii,iv,v,vi c) ii,i,iv,iii,v,vi d) i,ii,iii,iv,vi,v
4. What is the answer to this expression, 22 % 3 is?: a) 7 b) 1 c) 0 d) 5
5. Mathematical operations can be performed on a string. State whether true or false. a) True b) False
6. Operators with the same precedence are evaluated in which manner?
a) Left to Right b) Right to Left c) Can’t say d) None of the mentioned
7. What is the output of this expression, 3*1**3? : a) 27 b) 9 c) 3 d) 1
8. Which one of the following has the same precedence level?
a) Addition and Subtraction b) Multiplication, Division and Addition
c) Multiplication, Division, Addition and Subtraction d) Addition and Multiplication
9. The expression Int(x) implies that the variable x is converted to integer. State whether true or false.
a) True b) False
10. Which one of the following has the highest precedence in the expression?
a) Exponential b) Addition c) Multiplication d) Parentheses
CORE DATA TYPES
1. Which of these in not a core data type?
a) Lists b) Dictionary c) Tuples d) Class
2. Given a function that does not return any value, What value is thrown by default when executed in shell.
a) int b) bool c) void d) None
3. Following set of commands are executed in shell, what will be the output? str="hello" str[:2]
a) he b) lo c) olleh d) hello
4. Which of the following will run without errors ?
a) round(45.8) b) round(6352.898,2,5) c) round() d) round(7463.123,2,1)