1. All keywords in Python are in
a. Lower case
b. Upper case
c. Capitalized
d. None of mentioned
Ans : None of mentioned
2. Which of the following is true for variable names in python ?
a. Unlimited length
b. All private members must have leading and trailling underscores
c . Uhnderscore and ampersand are the only two special characters allowed
d. None of mentioned
Ans : Unlimited length
3. Which of the following can not be a variable ?
a. _init_
b. in
c. it
d. on
Ans : in
4. Which one of these is floor division ?
a. /
b. //
c. %
d. None of the mentioned
Ans : //
5. why are local variable names beginning with an underscore discouraged ?
a. They are used to indicate a private variable of a class
b. They confuse the interperter
c. They are used to indicate global variables
d. They slow down execution
Ans : They are used to indicate a private variable of a class
6. Is python case sensitive when dealing with identifiers ?
a. Yes
b. No
c. Machine dependent
d. None of the mentioned
Ans : Yes
7. What is answer of this expression, 22%3 is ?
a. 7
b. 1
c. 0
d. 5
Ans : 1
8. Mathematical operations can be performed on a string. State whether true of false.
a. True
b. False
c. May be
d. can't say
Ans : False
9. Which of these in not a core data type ?
a. Lists
b. Dictionary
c. Tuples
d. Class
Ans : Class
10. 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
Ans : None
11. What is the return type of function id ?
a. Int
b. Float
c. Bool
d. Dict
Ans : Int
12. Which of the following is not a complex number ?
a. k= 2+3j
b. k= complex(2,3)
c. k= 2+3j
d. k= 2+3j
Ans : k = 2+3j
13. What is the output of print 0.1+0.2 ==0.3 ?
a. True
b. False
c. Machine dependent
d. Error
Ans : False
14. What is the return value of trunc() ?
a. Int
b. Bool
c. Float
d. None
Ans : Int
15. In order to store values in terms of key and value we use what core data type
a. List
b. Tuple
c. Class
d. Dictionary
Ans : Dictionary
16. What is the output of the following expression :
`print(4.00/(2.0+2.0))
a. Error
b. 1.0
c. 1.00
d. 1
Ans : 1.0
17. What is the value of the expression :
float(4+int (2.39)%2)
a. 5.0
b. 5
c. 4.0
d. 4
Ans : 4.0
18. Which among the following list of operators has the highest precedence ?
+, -, **, %, /, <<, >>, |
a. <<, >>
b. **
c. |
d. %
Ans : **
19. Which is the result of the snippet of code shown below if x=1 ?
x<<2
a. 8
b. 1
c. 2
d. 4
Ans : 4
20. what is the value of x if :
x>>2=2
a. 8
b. 4
c. 2
d. 1
Ans : 8
0 Comments