1.Which type of programming does Python support?
A) Object- oriented programming
B) structured programming
c) Functional programming
d)All of the mentioned
ans. All of the mentioned
2. All keywords in python are in ?
A) lowercase
b)UPPERCASE
c) Capitalized
d)None of the mentioned
ans. None of the mentioned
3. Which of the following variable declaration is incorrect?
A) a_=3
b) _a=3
c) a?=3
D) All
ans. a?=3
4. Which of the following declarations is incorrect?
A) _x=1
B) _x=9
c)_xy_=7
d)None of these
ans. None of these
5. Which of the following declarations is incorrect in python language?
A) xyzp =5,000,000
B)x y z p = 5000 6000 7000 8000
C)x, y, z, p = 5000 6000 7000 8000
D)x_y_z_p =5,000,000
ans. x y z p = 5000 6000 7000 8000
6. ___ is correct regarding the object oriented programming concept in python?
A) classes are real world entities
B) Objects are real world entities
C)Objects and classes are real world entities
D) objects are real- world entities while classes are not real
ans. objects are real- world entities while classes are not real
7. Why does the name of local variables start with an underscore denotes?
A) To identify the variable
B) To identify the constant
C) It indicates a public variable of a class
D)variables cannot be accessed from outside the class
ans. variables cannot be accessed from outside the class
8.Which of the following is correct about python?
A) It supports automatic garbage collection
B) It can be easily integrated with C,C++ COM ActiveX, CORBA and Java
C) Both of the above
D) None of the above
ans. Both of the above
9. Which of the following data types is not supported in python?
A) Number
B) String
C) List
D) slice
ans. slice
10. What value does the following expression evaluation to ?
print(5+8*((3*5)-9)/10)
A) 9.0
B) 9.8
C) 10
D)10.0
ans. 9.8
11. What is the output of >>> float (‘12.6’)
A) 12.6
B) ‘12.6
C) 12
D) syntax error
ans. ‘12.6
12. Which of the following statements will be true?
A) Python allows you to assign a single value to multiple variables simultaneously
B) you can assign multiple values to multiple variables by separating variables and values with commas
C) you can assign the same value to multiple variables by using=consecutively
D) All of the above
ans. All of the above
13. What is the output of >>> float (‘12.6’)
A) 12.6
B) ‘12.6’
C)12
D) syntax error
ans. 12.6
14. Which of the following is valid python identifiers?
A) 10 Marks
B)e@mail
C)If
D) _my_python
ans. _my_python
15. Which of the following cannot be a variable?
A) _init_
B) in
C) it
D) on
ans. in
16. What is the output of the following statement?
print ((2,4)+(1,5))
A) (2,4), (4,5)
B) (3,9)
C) (2,4,1,5)
D) Invalid Syntax
ans. (2,4,1,5)