Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 34 (25 MCQs)

Quiz Instructions

Select an option to see the correct answer instantly.

1. What will be output for the folllowing code?class test:def ..... init ..... (self, a):self.a=a def display(self):print(self.a)obj=test()obj.display()
2. What is the output of the following list assignmentaList = [4, 8, 12, 16]aList[1:4] = [20, 24, 28]print(aList)
3. Select the correct answer:x = 15y = 4print( 'x * y')
4. Which of the following is the correct way to call a function?
5. Errors in code
6. To repeat a fixed number of times use a
7. Which of the following for loops would print the following numbers?3 5 7 9
8. Which keyword is used to display output in Python?
9. Which kind of loop would be used?I need a program that will keep letting me add money to a piggy bank until I get to $ 100.
10. What is the output of program below?motorcycles = ['honda', 'yamaha', 'suzuki']motorcycles.sort()print(motorcycles)
11. In the following code, what is happening?foo = "bar"
12. Game.spawnPlayerXY("captain", 9, 18)How many arguments does the spawnPlayerXY( ) method use here?
13. Identify the code that properly creates an instance of a class named Car.
14. What is a piece of code that can take inputs to perform a certain task?
15. Which of the following programs prints ten lines?
16. Look at the following code:age = input ("What is your age? ")age = age + 1print (age)If the user inputs 23, what is the result of the code?
17. What is the output of the following code?listOne = [20, 40, 60, 80]listTwo = [20, 40, 60, 80]print(listOne == listTwo)print(listOne is listTwo)
18. T=((1, 2, 3), (3, 4))what is T[1][1]
19. MATCH THE FOLLOWING:1. concatenation A) +=2. Append B) [ ]3. String Slicing C) * 4. Repeating D) +
20. What is the output of the following code?for i in range(1, 6, 2):print(i)
21. What would be printed by the commandprint('12-5')
22. If we needed to store information such as a POSTCODE in PYTHON, what data type would we use?
23. Identify the first statement that creates a class named Employee.
24. A="god help those who help themselves""help" in "a"
25. The number of lines drawn in each case, assuming that the turtle module has been imported:Case 1:for i in range(0, 10):turtle.forward(100)turtle.left(90)Case 2:for i in range(1, 10):turtle.forward(100)turtle.left(90)