This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 9 Practical Work Python Exercises – Quiz 34 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books 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() A) Runs normally, doesn't display anything. B) Displays 0, which is the automatic default value. C) Error as one argument is required while creating the object. D) Error as display function requires additional argument. Show Answer Correct Answer: C) Error as one argument is required while creating the object. 2. What is the output of the following list assignmentaList = [4, 8, 12, 16]aList[1:4] = [20, 24, 28]print(aList) A) [4, 20, 24, 28, 8, 12, 16]. B) [4, 20, 24, 28]. C) All the above. D) None of the above. Show Answer Correct Answer: B) [4, 20, 24, 28]. 3. Select the correct answer:x = 15y = 4print( 'x * y') A) 59. B) 60. C) 54. D) 22. Show Answer Correct Answer: B) 60. 4. Which of the following is the correct way to call a function? A) Def distance ( ):. B) Distance. C) Distance ( ). D) Distance ( ):. Show Answer Correct Answer: C) Distance ( ). 5. Errors in code A) Error. B) Bug. C) Mistake. D) Fly. Show Answer Correct Answer: B) Bug. 6. To repeat a fixed number of times use a A) While loop. B) For loop. C) If loop. D) Indentation. Show Answer Correct Answer: B) For loop. 7. Which of the following for loops would print the following numbers?3 5 7 9 A) For i in range(3, 10, 2):print(i). B) For i in range(3, 9, 2):print(i). C) For i in range(9):print(i). D) For i in range(3, 9):print(i). Show Answer Correct Answer: A) For i in range(3, 10, 2):print(i). 8. Which keyword is used to display output in Python? A) Output. B) Input. C) Print. D) Display. Show Answer Correct Answer: C) Print. 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. A) FOR Loop. B) WHILE Loop. C) All the above. D) None of the above. Show Answer Correct Answer: B) WHILE Loop. 10. What is the output of program below?motorcycles = ['honda', 'yamaha', 'suzuki']motorcycles.sort()print(motorcycles) A) ['honda', 'yamaha', 'suzuki']. B) ['yamaha', 'suzuki', 'honda']. C) ['honda', 'suzuki', 'yamaha']. D) ['suzuki', 'yamaha', 'honda']. Show Answer Correct Answer: C) ['honda', 'suzuki', 'yamaha']. 11. In the following code, what is happening?foo = "bar" A) A variable named foo is being created, with a value of "bar". B) A variable named bar is being created, with a value of "foo". C) All the above. D) None of the above. Show Answer Correct Answer: A) A variable named foo is being created, with a value of "bar". 12. Game.spawnPlayerXY("captain", 9, 18)How many arguments does the spawnPlayerXY( ) method use here? A) 1 argument which is "captain". B) There are no arguments in the method as methods do not need arguments mandatorily. C) 2 arguments 9 and 18. D) 3 arguments "captain", 9 and 18. Show Answer Correct Answer: D) 3 arguments "captain", 9 and 18. 13. Identify the code that properly creates an instance of a class named Car. A) Camero.car(make, model). B) Tesla = car.make(). C) Mustang = Car(make, model). D) Porsche = car.make.model(). Show Answer Correct Answer: C) Mustang = Car(make, model). 14. What is a piece of code that can take inputs to perform a certain task? A) A function. B) Arguments. C) Parameters. D) None of the above. Show Answer Correct Answer: A) A function. 15. Which of the following programs prints ten lines? A) For i in range(10):print("hi"). B) For i = 1 to 10:print("hi"). C) For i in 1-10:print("hi"). D) For i from 0 to 9:print("hi"). Show Answer Correct Answer: A) For i in range(10):print("hi"). 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? A) 23. B) 24. C) Age. D) An error message. Show Answer Correct Answer: D) An error message. 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) A) TRUETRUE. B) TRUEFALSE. C) FALSETRUE. D) None of the above. Show Answer Correct Answer: B) TRUEFALSE. 18. T=((1, 2, 3), (3, 4))what is T[1][1] A) 4. B) 3. C) 2. D) 1. Show Answer Correct Answer: A) 4. 19. MATCH THE FOLLOWING:1. concatenation A) +=2. Append B) [ ]3. String Slicing C) * 4. Repeating D) + A) 1-B. 2-A, 3-C, 4-D. B) 1-D. 2-A, 3-B, 4-C. C) 1-A, 2-B, 3-C, 4-D. D) 1-A, 2-D, 3-C, 4-B. Show Answer Correct Answer: B) 1-D. 2-A, 3-B, 4-C. 20. What is the output of the following code?for i in range(1, 6, 2):print(i) A) 12345. B) 1234. C) 135. D) 1357. Show Answer Correct Answer: C) 135. 21. What would be printed by the commandprint('12-5') A) 12-5. B) '12-5'. C) 7. D) '7'. Show Answer Correct Answer: C) 7. 22. If we needed to store information such as a POSTCODE in PYTHON, what data type would we use? A) String (alphanumerical). B) Float (decimal point). C) Boolean (true or false). D) None of the above. Show Answer Correct Answer: A) String (alphanumerical). 23. Identify the first statement that creates a class named Employee. A) Class Employee():. B) Class Employee:. C) Class employee:. D) Class Employee:. Show Answer Correct Answer: B) Class Employee:. 24. A="god help those who help themselves""help" in "a" A) True. B) False. C) Wrong out put. D) Error. Show Answer Correct Answer: A) True. 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) A) 10, 9. B) 9, 10. C) 9, 9. D) 10, 10. Show Answer Correct Answer: A) 10, 9. ← PreviousNext →Related QuizzesClass 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 1Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 2Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 3Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 4Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 5Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 6Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 7Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 8Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 9Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 10 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books