Multiple Choice Question On PYTHON
Part - 01
Some Important Points :
--> Developed by : Guido van Rossum
--> Extesion : .py
--> Case Sensitive : yes
--> Support : oops yes
1. Like the else, the elif statement is optional
a. True b. False
2. Suppose s is “\t\tWorld\n”, what is s.strip() ?
a. World b. world
c. WORLD d. \tWorld\n
Explanation : The string strip() method in python is built-in from Python. It helps the developer to remove the whitespaces or specific characters from the string at the beginning and end of the string.
3. Function can not have return statement
False
4. Which method is used to delete an object created by initializing constructor.
Destructor
5. What gets printed ? nums=set([1,1,2,3,3,3,4])
print(len(nums))
a. 4 b. 6
c. 2 d. 7
6. E=’hello’ print E.find(‘e’)
a. 1 b. 5
c. 2 d. 3
7. Which type of Programming does Python support?
a) object-oriented programmingb) structured programming
c) functional programming
d) all of the mentioned
c. 1 d. 3
9. Which keyword is used for function in Python language?
a) Functionb) def
c) Fun
d) Define
while True:
if i%3 == 0:
break
print(i)
i + = 1
b) error
c) 1 2
d) none of the mentioned
(2**3)**2
2**3**2
c) 64, 512, 64
d) 64, 64, 64
print("%.2f"%x)
a) 56.236
b) 56.23
c) 56.0000
d) 56.24
15. What will be the output of the following Python code ?
for i in [1, 2, 3, 4][::-1]:
print (i)
Ans : 4 3 2 1
16. What will be the output of the following code snippet?
print(2**3 + (5 + 6)**(1 + 1))
a = [1, 2, 3, 4, 5]
sum = 0
for ele in a:
sum += ele
print(sum)
Comments
Post a Comment