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 2 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 2 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Choose the correct data type:Age (in whole years)Example:17 A) Boolean. B) Real/Float. C) String. D) Character. E) Integer. Show Answer Correct Answer: E) Integer. 2. What data type would store the value:6.4? A) String. B) List. C) Boolean. D) Float. Show Answer Correct Answer: D) Float. 3. If you want to create an empty list called colours, which of the following pieces of code is correct? A) Colours = ( ). B) Colors = [ ]. C) Colours = [ ]. D) Colours = { }. Show Answer Correct Answer: C) Colours = [ ]. 4. Choose the correct data type:"K" A) Boolean. B) Character. C) String. D) Real/Float. E) Integer. Show Answer Correct Answer: B) Character. 5. Drink ..... choices = ["coffee", "tea", "water", "juice", "soda"]for drink in drink ..... choices:print(drink) A) Drink. B) "coffee tea water juice soda". C) "coffee". D) ["coffee", "tea", "water", "juice", "soda"]. Show Answer Correct Answer: B) "coffee tea water juice soda". 6. What are Strings? A) A type of data that represents text. In both Python and JavaScript, strings are represented by text inside quotes. B) A character or thing that can perform actions. C) The rules for correct spelling, grammar, and punctuation in a programming language. D) An action performed by an object. Show Answer Correct Answer: A) A type of data that represents text. In both Python and JavaScript, strings are represented by text inside quotes. 7. What will be the output of the following Python expression? round(4.5676, 2)? A) 4.57. B) 4.6. C) 4.5. D) 4.56. Show Answer Correct Answer: A) 4.57. 8. ..... data type contain integer values with no decimal such as 1, 200, 999 etc. A) Int. B) String. C) Char. D) Float. Show Answer Correct Answer: A) Int. 9. What is the condition in this code?if name == "Catherine":print("Hello, '' + name) A) Name == "Catherine". B) Print("Hello, '' + name). C) ==. D) If name == "Catherine":. Show Answer Correct Answer: A) Name == "Catherine". 10. What type of programming language is Python? A) Block based. B) Command Line. C) Fill in the blanks. D) Object Oriented. Show Answer Correct Answer: B) Command Line. 11. Numbers = [1, 2, 3, 4, 5]print ( numbers.pop() )The program above prints A) 1. B) 5. C) [2, 3, 4, 5]. D) Syntax error. Show Answer Correct Answer: B) 5. 12. What is printed?cheer = "Go Eagles!"print cheer[0:1] A) Go. B) O. C) "Go". D) G. Show Answer Correct Answer: D) G. 13. L=[2, 4, 8, 16, 32, 64] what is L[:2] A) [2, 4]. B) [2, 4, 8]. C) 2, 4. D) None of the above. Show Answer Correct Answer: A) [2, 4]. 14. Who is the inventor of python language? A) Bjarne Stroustrup. B) James Gosling. C) Guido van Rossum. D) Dennis Ritchie. Show Answer Correct Answer: C) Guido van Rossum. 15. Which symbol surrounds a dictionary? A) (. B) [. C) {. D) :. Show Answer Correct Answer: C) {. 16. Which of the following commands will return the length of the list mylist? A) Len(mylist). B) Length(mylist). C) Mylist.length(). D) Mylist.len(). Show Answer Correct Answer: A) Len(mylist). 17. 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. 18. The datatype whose representation is unknown are called A) Derived data type. B) Built in data type. C) Concrete data type. D) Abstract data type. Show Answer Correct Answer: D) Abstract data type. 19. 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(). 20. Consider the code and What is the result?s='AB CD'list=list(s)list.append('EF')print(list) A) ['A', 'B', 'C', 'D', 'E', 'F']. B) ('A', 'B', ' ', 'C', 'D', 'EF'). C) {'A', 'B', ' ', 'C', 'D', 'EF'}. D) ['A', 'B', ' ', 'C', 'D', 'EF']. Show Answer Correct Answer: D) ['A', 'B', ' ', 'C', 'D', 'EF']. 21. In Python, what are if-statements used for? A) Indexing. B) Decision Making. C) Looping. D) Testing. Show Answer Correct Answer: B) Decision Making. 22. 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) Players.addend("Bob"). C) Players.append("Bob"). D) Player.append("Bob"). Show Answer Correct Answer: C) Players.append("Bob"). 23. What button do you press to run your program? A) The rocket. B) The boat. C) The plane. D) The car. Show Answer Correct Answer: A) The rocket. 24. Which of the following are not sequences supported in Python? A) Dictionary. B) Integer. C) Tuple. D) List. Show Answer Correct Answer: B) Integer. 25. What error will occur when you execute the following code? MANGO = APPLE A) Syntax Error. B) Value Error. C) NameError. D) Type Error. Show Answer Correct Answer: C) NameError. 26. 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) 3. C) 2. D) 4. Show Answer Correct Answer: B) 3. 27. ..... 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( ). 28. Which symbol is used to print more than one item on a single line? A) ,. B) $. C) :. D) ;. Show Answer Correct Answer: A) ,. 29. The command that will print a line of command on the program is: A) Print. B) Echo. C) Hey, Alexa. D) Speak. Show Answer Correct Answer: A) Print. 30. Choose the correct data type:6 A) Real/Float. B) Character. C) Boolean. D) Integer. E) String. Show Answer Correct Answer: D) Integer. 31. 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. 32. The datatype whose representation is known are called A) Derived data type. B) Built in data type. C) Abstract data type. D) Concrete data type. Show Answer Correct Answer: D) Concrete data type. 33. 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. 34. 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:2]). B) Print(nameList[0:1]). C) Print(nameList[1:3]). D) Print(nameList["Harry":"Jesse"]). Show Answer Correct Answer: C) Print(nameList[1:3]). 35. Presenting the results back to a user is known as A) Input. B) Storage. C) Processing. D) Output. Show Answer Correct Answer: D) Output. 36. 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". 37. Which of these codes is correct for creating a list of numbers? A) Num = ('10', '29', '37', '109'). B) Num = ['10', '29', '37', '109']. C) Num = ['10 29 37 109']. D) Num == ('10', '29', '37', '109'). Show Answer Correct Answer: B) Num = ['10', '29', '37', '109']. 38. Which of the following statements correctly defines a function named "haunted" that takes a parameter named "apple" ? A) Haunted. B) Haunted(apple). C) Apple. D) Def haunted(apple):. Show Answer Correct Answer: D) Def haunted(apple):. 39. Str="world of python programming"len(str) A) 25. B) 24. C) 28. D) 27. Show Answer Correct Answer: D) 27. 40. What can be used to store information and values so that it can be used later? A) Variable. B) Graphic. C) Output. D) Print. Show Answer Correct Answer: A) Variable. 41. Which of the following is not a keyword? A) Nonlocal. B) Assert. C) Pass. D) Eval. Show Answer Correct Answer: D) Eval. 42. What is missing in the square braces?cheer = "Go Eagles!"print cheer[ ]If the output is Eagle A) [4:9]. B) [2:8]. C) [3:8]. D) [3:7]. Show Answer Correct Answer: C) [3:8]. 43. Output of the following question is:#program for text addition# input() methodf ..... name= "hello"l ..... name ="world"print( f ..... name + l ..... name) A) Helloworld. B) F name+l name. C) Error. D) Hello world. Show Answer Correct Answer: A) Helloworld. 44. Numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]Which of the following code gives the following list as the output[4, 5, 6] A) Numbers[4, 5, 6]. B) Numbers[4:6]. C) Numbers[3:6]. D) Numbers[3, 4, 5]. Show Answer Correct Answer: C) Numbers[3:6]. 45. Concatenation is a ..... operator. A) String. B) Relational. C) Logical. D) Arithmetic. Show Answer Correct Answer: A) String. 46. What is the output of program below?mariana ..... islands = ['Saipan', 'Tinian', 'Rota']mariana ..... islands[0] = 'Guam'print(mariana ..... islands) A) ['Guam', 'Saipan', 'Tinian', 'Rota']. B) ['Saipan', 'Tinian', 'Rota']. C) ['Saipan', 'Tinian', 'Rota', 'Guam']. D) ['Guam', 'Tinian', 'Rota']. Show Answer Correct Answer: D) ['Guam', 'Tinian', 'Rota']. 47. A dictionary is an example of a sequence ..... A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 48. Booleans represent one of two values:True or False. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 49. Inside a function with two parameters, print the first parameter. def my ..... function(fname, lname):print( ..... ) A) Fname. B) Lname. C) Lastname. D) My function. Show Answer Correct Answer: A) Fname. 50. What do we use at the start of a comment line? A) *. B) ''. C) @. D) #. Show Answer Correct Answer: D) #. 51. In which language is Python written?English A) English. B) PHP. C) C. D) ALL OF THE ABOVE. Show Answer Correct Answer: C) C. 52. When you read code carefully to look for errors and fix them A) Try again. B) Debug. C) Fix. D) Mistake. Show Answer Correct Answer: B) Debug. 53. A count controlled loop will ..... A) Repeat code until a condition is met. B) Repeat code a specific amount of times. C) Repeat code a random amount of times. D) None of the above. Show Answer Correct Answer: B) Repeat code a specific amount of times. 54. What is the order of precedence in Python?i. Parenthesisii. Exponentialiii. Multiplicationiv. Divisionv. Additionvi. Subtraction A) Ii, i, iii, iv, v, vi. B) I, ii, iii, iv, v, vi. C) Ii, i, iv, iii, v, vi. D) I, ii, iii, vi, v, iv. Show Answer Correct Answer: B) I, ii, iii, iv, v, vi. 55. Choose the correct data type:240.00 A) Boolean. B) String. C) Integer. D) Real/Float. E) Character. Show Answer Correct Answer: D) Real/Float. 56. Which data type is used to store decimal numbers in Python? A) Float. B) Boolean. C) Integer. D) String. Show Answer Correct Answer: A) Float. 57. What will the output be from the following code?print("Hello" + str(2) + "world!") A) Hello2world!. B) Syntax Error. C) Hello Hello world! world!. D) Hello world! Hello world!. Show Answer Correct Answer: A) Hello2world!. 58. A condition controlled loop is ..... A) A while loop. B) A for loop. C) All the above. D) None of the above. Show Answer Correct Answer: A) A while loop. 59. What is the index number for 'Spain'?['England', 'Brazil', 'Spain', 'France'] A) 2. B) 0. C) 3. D) 1. Show Answer Correct Answer: A) 2. 60. Choose the correct alternative out of the following A) While loops can be used to create infinite loops only. B) Python if else conditionals cannot be used to compare values. C) Python is nothing but english. D) The inputs to the functions or methods are called arguments. Show Answer Correct Answer: D) The inputs to the functions or methods are called arguments. ← 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 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 9 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books