This quiz works best with JavaScript enabled. Home > Cbse > Class 11 > Science > Computer Science > Class 11 Computer Science Chapter 9 Practical Work Python Exercises – Quiz 5 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 5 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Everything that we want to display in a print() function must: A) Quotation marks- "". B) Be inside single quotation marks-''. C) Be inside parentheses-(). D) Be inside hash marks-#. Show Answer Correct Answer: A) Quotation marks- "". 2. The collection of modules and packages that together cater to a specific type of applications or requirements, is called ..... A) Classes. B) Module. C) Library. D) Documentation. Show Answer Correct Answer: C) Library. 3. Look at the following code:Length = input ("Length: ")Width = input ("Width: ")Area = Length * WidthPerimeter = 2 * (Length + Width)print (Perimeter)What is the result of this code if the user inputed 2 then 4? A) 12. B) An error message. C) Perimeter. D) 16. Show Answer Correct Answer: A) 12. 4. Suppose list1 is [1, 3, 2], What is list1 * 2? A) [2, 6, 4]. B) [1, 3, 2, 1, 3, 2]. C) [1, 3, 2, 1, 3]. D) [1, 3, 2, 3, 2, 1]. Show Answer Correct Answer: B) [1, 3, 2, 1, 3, 2]. 5. S1="Hello"s2="10"print(s1+n1)What is the error in this code? A) Number written in quotes. B) Colon not written after print statement. C) String cannot be multiplied with a string. D) String 2 written in quotes. Show Answer Correct Answer: C) String cannot be multiplied with a string. 6. In the Python example x = 9, 9 is the ..... A) Variable. B) Value. C) Number. D) Answer. Show Answer Correct Answer: B) Value. 7. What is Property? A) A character or thing that can perform actions. B) An action performed by an object. C) A type of data that represents text. D) Data about or belonging to an object. Show Answer Correct Answer: D) Data about or belonging to an object. 8. Which operator can be used to compare two values? A) ==. B) =. C) <>. D) !=. Show Answer Correct Answer: A) ==. 9. In Python, the command "while" will create a: A) Function. B) A chocolate cake. C) Variable. D) Loop. Show Answer Correct Answer: D) Loop. 10. What is the output of this python code?def foo(x):x[0] = ['def'] x[1] = ['abc'] return id(x)q = ['abc', 'def']print(id(q) == foo(q)) A) Error. B) True. C) False. D) None. Show Answer Correct Answer: B) True. 11. A named sequence of statements that returns a result is known as which of the following? A) Definition. B) Module. C) Function. D) Turtle. E) Procedure. Show Answer Correct Answer: C) Function. 12. What is the output of the following code?valueOne = 5 ** 2valueTwo = 5 ** 3print(valueOne)print(valueTwo) A) 1015. B) 25125. C) ERROR. D) None of the above. Show Answer Correct Answer: B) 25125. 13. What is the goal of managing the Burmese Python population? A) To completely eradicate them from Florida. B) To train them for pest control. C) To manage and mitigate their impacts. D) To use them for scientific research. Show Answer Correct Answer: C) To manage and mitigate their impacts. 14. O.73 is an example of a A) Floating point number. B) Boolean. C) Leanboo. D) Integer. Show Answer Correct Answer: A) Floating point number. 15. Which of the following is an example of an 'object.property(attribute)' A) Name.penup. B) Name.pendraw(10). C) Name.penup(). D) Name.pen(5). Show Answer Correct Answer: C) Name.penup(). 16. What is an expression in Python A) A saying with a meaning behind it. B) A math problem. C) Something i feel strongly about. D) Syntax. Show Answer Correct Answer: B) A math problem. 17. Numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]print ( numbers[-3] == numbers[7])The output of the program above is A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 18. ..... method will returns number of key-value pairs in the given dictionary. A) Len( ). B) Values( ). C) Del( ). D) Pop( ). E) Keys( ). Show Answer Correct Answer: A) Len( ). 19. In a list called "players" if you wanted to delete the item with an index of 3 which of the following examples of code would be correct? A) Players.pop[3]. B) Players.remove(3). C) Players.delete(3). D) Players.pop(3). Show Answer Correct Answer: D) Players.pop(3). 20. Who is the creator of Python Language A) Dennis Retchie. B) James Gosling. C) Bjarne stroustrup. D) Guido van Rossum. Show Answer Correct Answer: D) Guido van Rossum. 21. Which option best describes how user input can impact our programs? A) It forces the user to write their own program. B) It allows us to make programs interactive. C) It lets us grade the user on their work. D) User-input has no impact on our programs. Show Answer Correct Answer: B) It allows us to make programs interactive. 22. Please select all correct ways to empty the following dictionarystudent = { "name": "Emma", "class":9, "marks":75 }Find the output:print(student.get('class')) A) "class":9. B) 3. C) 9. D) None of these. Show Answer Correct Answer: C) 9. 23. What does != represent? A) Check for error. B) Not equal to. C) Possibly equal to. D) Don't assign a value. Show Answer Correct Answer: B) Not equal to. 24. ..... method removes all items from the particular dictionary. A) Clear( ). B) Pop( ). C) Del. D) None of the above. Show Answer Correct Answer: A) Clear( ). 25. How many elements can be inserted using append() method? A) 3. B) 1. C) Any number of elements. D) 2. Show Answer Correct Answer: B) 1. 26. What was the original purpose of creating Python? A) The original purpose of creating Python was to dominate the programming market. B) Python was created to be the most difficult programming language to learn. C) The original purpose of creating Python was to develop a language that was easy to read, write, and maintain. D) The original purpose of creating Python was to replace all other existing programming languages. Show Answer Correct Answer: C) The original purpose of creating Python was to develop a language that was easy to read, write, and maintain. 27. Any string is False, except empty strings. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 28. In the following code, n is a/an ..... ?n = '5' A) Operator. B) Tuple. C) String. D) Integer. Show Answer Correct Answer: C) String. 29. Choose the correct data type:"You follow the monster into the cave!" A) Integer. B) Boolean. C) String. D) Character. E) Real/Float. Show Answer Correct Answer: C) String. 30. What is the value of num when this loop completes?num = 0for i in range(2, 8, 2):num += i A) 8. B) 12. C) 20. D) 2. Show Answer Correct Answer: B) 12. 31. What will be the output of the following program:fruits = ["apple", "banana", "cherry"] for x in fruits:if x == "banana":print(x) A) Banana. B) Cherry. C) Apple. D) Apple cherry. Show Answer Correct Answer: A) Banana. 32. What do For Loops do? A) A programming structure used to repeat actions without the player needing to write the same lines of code over and over. B) Data about or belonging to an object. C) Repeat a block of code while a certain condition is true. D) Repeat a block of code a certain number of times. Show Answer Correct Answer: D) Repeat a block of code a certain number of times. 33. Suppose list=[12, 3, 22, "mago", "hello"], what is list[-6] A) Error. B) None. C) Mango. D) 12. Show Answer Correct Answer: A) Error. 34. What is displayed to the screen when the following code runs? esports = ["Donkey Kong", "Galaga", "Pac Man"] esports.insert(2, "apple") print(esports) A) ["Donkey Kong", "Galaga", "Pac Man", "apple"]. B) ["Donkey Kong", "Galaga", "apple", "Pac Man"]. C) ["Donkey Kong", "Galaga", "Pac Man"]. D) [ "apple", "Donkey Kong", "Galaga", "Pac Man"]. Show Answer Correct Answer: B) ["Donkey Kong", "Galaga", "apple", "Pac Man"]. 35. The title( ) function A) Assigns title. B) Returns the title of the file. C) Returns string in title case. D) None of the above. Show Answer Correct Answer: C) Returns string in title case. 36. Items are accessed by their position in a dictionary A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 37. Ch=99print(chr(ch)) A) D. B) C. C) B. D) A. Show Answer Correct Answer: B) C. 38. What function is used to output a message in python? A) Input=name. B) Print. C) Print(""). D) Name=input. Show Answer Correct Answer: C) Print(""). 39. Which of the following is a Python command A) Print (""). B) Print "name". C) @echo off. D) Echo. Show Answer Correct Answer: A) Print (""). 40. The "break" command: A) Will quit the whole program. B) Will stop the loop and continue with any instructions after the loop. C) Will skip any remaining code in the loop, but go back to the top and restart the loop. D) Will cause an error. Show Answer Correct Answer: B) Will stop the loop and continue with any instructions after the loop. 41. What is the output of program below?mariana ..... islands = ['Saipan', 'Tinian', 'Rota', 'Guam']mariana ..... islands.sort()print(mariana ..... islands) A) ['Tinian', 'Saipan', 'Rota', 'Guam']. B) ['Saipan', 'Rota', 'Guam', 'Tinian']. C) ['Guam', 'Tinian', 'Rota', 'Saipan']. D) ['Guam', 'Rota', 'Saipan', 'Tinian']. Show Answer Correct Answer: D) ['Guam', 'Rota', 'Saipan', 'Tinian']. 42. Do you think a variable to store a car's value would be a class or instance variable? A) Class. B) Instance. C) All the above. D) None of the above. Show Answer Correct Answer: B) Instance. 43. Why is iteration important? A) It determines the order in which instructions are carried out. B) It allows code to be simplified by removing duplicated steps. C) It allows multiple paths through a program. D) None of the above. Show Answer Correct Answer: B) It allows code to be simplified by removing duplicated steps. 44. Print(9>2 and 6<=6) A) TRUE. B) FALSE. C) All the above. D) None of the above. Show Answer Correct Answer: A) TRUE. 45. Choose the correct data type:-5.88 A) Real/Float. B) Integer. C) Boolean. D) Character. E) String. Show Answer Correct Answer: A) Real/Float. 46. What will be displayed on the screen when the following code is run? esports = ["Donkey Kong", "Galaga", "Pac Man"] print( esports[1] ) A) Donkey Kong. B) Galaga. C) Syntax error; you can't access individual list items this way. D) Pac Man. Show Answer Correct Answer: B) Galaga. 47. How many return statements can you place inside one function body? A) As many as needed; each marks a spot where program flow returns to the calling code. B) You can have one return statement per parameter that is defined by the function "def". C) You are limited by the number of body statements, divided by 2. D) Exactly one. Show Answer Correct Answer: A) As many as needed; each marks a spot where program flow returns to the calling code. 48. What will be the data type of num1 if the following code is executed?num1=float(5) A) Float. B) Number. C) String. D) Int. Show Answer Correct Answer: A) Float. 49. Why the following variable name invalid:1st ..... Name A) The variable name starts with a number. B) No special characters other than underscore. C) There is nothing wrong with this variable name. D) Keep names meaningful. Show Answer Correct Answer: A) The variable name starts with a number. 50. When do you know when you come to the end of the loop? A) Its states End loop. B) The command End is given. C) The indentation stops. D) None of the above. Show Answer Correct Answer: C) The indentation stops. 51. Word = "amazing"For the given string if we run word[2:5] what does it mean? A) It will extract alphabets from index 2 to index 4. B) It will extract alphabets from position 2 to position 5. C) It will extract alphabets from position 2 to position 4. D) It will extract alphabets from index 2 to index 5. Show Answer Correct Answer: A) It will extract alphabets from index 2 to index 4. 52. Which of the following would NOT work as a variable name? A) A. B) X. C) Len. D) Length. Show Answer Correct Answer: C) Len. 53. Which of the following is the correct way to add the number 4 to mylist? A) 4.append(mylist). B) Mylist + 4. C) Mylist.append(4). D) Mylist.append([4]). Show Answer Correct Answer: C) Mylist.append(4). 54. Why is it important to continue researching Burmese Pythons? A) To export them back to Southeast Asia. B) To increase their population in the wild. C) To domesticate them for pet trade. D) To find their weaknesses and control their population. Show Answer Correct Answer: D) To find their weaknesses and control their population. 55. Suppose B is a subclass of A, to invoke the ..... init ..... method in A from B, what is the line of code you should write? A) ....init (A). B) ....init (self). C) ....init (self). D) ....init (B). Show Answer Correct Answer: B) ....init (self). 56. Fill in the blank such that the following Python code results in the formation of an inverted, equilateral triangle.import turtlet=turtle.Pen()for i in range(0, 3):t.forward(150)t.right( ..... ) A) -120. B) -60. C) 60. D) 120. Show Answer Correct Answer: D) 120. 57. If Python were to get into a fight with JavaScript, who would win? A) Python. B) JavaScript. C) All the above. D) None of the above. Show Answer Correct Answer: A) Python. 58. Str="world of python programming"str.upper() A) 'WORLD OF PYTHON PROGRAMMING STORE'. B) 'WORLD oF PYTHON PROGRAMMING STORE'. C) 'WORLD OF PYTHON PROGRaMMING STORE'. D) 'WORLD OF PyTHON PROGRAMMING STORE'. Show Answer Correct Answer: A) 'WORLD OF PYTHON PROGRAMMING STORE'. 59. Random.random() generates a floating point number between ..... and ..... A) 1 and 2. B) 1 and 0. C) 0 and 1. D) 0 and 10. Show Answer Correct Answer: C) 0 and 1. 60. A character or thing that can perform actions A) Object. B) Iterate. C) Code. D) Method. Show Answer Correct Answer: A) Object. ← PreviousNext →Related QuizzesScience QuizzesClass 11 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 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 9 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books