This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 9 Practical Work Python Exercises – Quiz 4 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 4 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What would be the output of the following code:for i in range(3):print(i) A) 1 2 3. B) I i i i. C) I i i. D) 0 1 2. Show Answer Correct Answer: D) 0 1 2. 2. Who is the inventor of python language? A) Guido van Rossum. B) Bjarne Stroustrup. C) Dennis Ritchie. D) James Gosling. Show Answer Correct Answer: A) Guido van Rossum. 3. Which symbol surrounds a dictionary? A) \{. B) (. C) [. D) :. Show Answer Correct Answer: A) \{. 4. Which of the following commands will return the length of the list mylist? A) Length(mylist). B) Len(mylist). C) Mylist.length(). D) Mylist.len(). Show Answer Correct Answer: B) Len(mylist). 5. If the return statement is not used inside the function, the function will return: A) 0. B) None. C) Null. D) Arbitary value. Show Answer Correct Answer: B) None. 6. The datatype whose representation is unknown are called A) Built in data type. B) Derived data type. C) Concrete data type. D) Abstract data type. Show Answer Correct Answer: D) Abstract data type. 7. Please select all correct ways to empty the following dictionarystudent = \{ "name": "Emma", "class":9, "marks":75 \} A) Del student. B) Del student[0:2]. C) Student.clear(). D) None of the above. Show Answer Correct Answer: C) Student.clear(). 8. Consider the code and What is the result?s='AB CD'list=list(s)list.append('EF')print(list) A) ('A', 'B', ' ', 'C', 'D', 'EF'). B) ['A', 'B', 'C', 'D', 'E', 'F']. C) \{'A', 'B', ' ', 'C', 'D', 'EF'\}. D) ['A', 'B', ' ', 'C', 'D', 'EF']. Show Answer Correct Answer: D) ['A', 'B', ' ', 'C', 'D', 'EF']. 9. In Python, what are if-statements used for? A) Looping. B) Indexing. C) Decision Making. D) Testing. Show Answer Correct Answer: C) Decision Making. 10. In a list called "players", if you wanted to add a player called "Bob" to the list, which of the following examples of code would be correct? A) Players.add("Bob"). B) Player.append("Bob"). C) Players.append("Bob"). D) Players.addend("Bob"). Show Answer Correct Answer: C) Players.append("Bob"). 11. What button do you press to run your program? A) The plane. B) The rocket. C) The boat. D) The car. Show Answer Correct Answer: B) The rocket. 12. A string is A) A named value that can change. B) A sequence of characters, which can include letters, numbers, symbols, punctuation and spacing. C) A file or set of files with related variables, functions, and classes that can be reused in other programs. D) A named, reusable set of programming statements to perform a specific task. Show Answer Correct Answer: B) A sequence of characters, which can include letters, numbers, symbols, punctuation and spacing. 13. Which of the following are not sequences supported in Python? A) List. B) Tuple. C) Integer. D) Dictionary. Show Answer Correct Answer: C) Integer. 14. What error will occur when you execute the following code? MANGO = APPLE A) NameError. B) Syntax Error. C) Type Error. D) Value Error. Show Answer Correct Answer: A) NameError. 15. Given the nested if-else below, what will be the value x when the code executed successfullyx = 0a = 5b = 5if a > 0:if b < 0:x = x + 5 elif a > 5:x = x + 4 else:x = x + 3else:x = x + 2print(x) A) 0. B) 4. C) 2. D) 3. Show Answer Correct Answer: D) 3. 16. ..... method adds a single item to the end of the list. A) Extend( ). B) Append( ). C) Insert( ). D) None of the above. Show Answer Correct Answer: B) Append( ). 17. Which symbol is used to print more than one item on a single line? A) $. B) :. C) ,. D) ;. Show Answer Correct Answer: C) ,. 18. The command that will print a line of command on the program is: A) Echo. B) Print. C) Hey, Alexa. D) Speak. Show Answer Correct Answer: B) Print. 19. Choose the correct data type:6 A) Character. B) String. C) Integer. D) Real/Float. E) Boolean. Show Answer Correct Answer: C) Integer. 20. How do you define the range of a for loop in Python? A) By using the range() function with start, stop, and step parameters. B) By using the len() function with the iterable as the parameter. C) By using the start, stop, and step parameters directly in the for loop. D) By using the range() function with only the stop parameter. Show Answer Correct Answer: A) By using the range() function with start, stop, and step parameters. 21. The datatype whose representation is known are called A) Built in data type. B) Derived data type. C) Concrete data type. D) Abstract data type. Show Answer Correct Answer: C) Concrete data type. 22. What is the window called where you write your code? A) Editor. B) Shell. C) All the above. D) None of the above. Show Answer Correct Answer: A) Editor. 23. NameList = ["John", "Harry", "Jesse", "John", "Marry", "Larry"]The list will be slice and show Harry and Jesse only. Which piece of code below would do this? A) Print(nameList[1:3]). B) Print(nameList[0:1]). C) Print(nameList[1:2]). D) Print(nameList["Harry":"Jesse"]). Show Answer Correct Answer: A) Print(nameList[1:3]). 24. Presenting the results back to a user is known as A) Input. B) Output. C) Storage. D) Processing. Show Answer Correct Answer: B) Output. 25. Enemy = hero.findNearestEnemy( )What is findNearestEnemy( )? A) It is a null function. B) It is a function of the object hero called "method". C) A variable. D) Function definition. Show Answer Correct Answer: B) It is a function of the object hero called "method". ← 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 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 10Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 11 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books