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 13 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 13 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What term is used to describe data passed into/out of a program? A) Variable. B) Loop. C) Constant. D) Parameter. Show Answer Correct Answer: D) Parameter. 2. C=35 if 34<43 else 43 A) 43. B) 1. C) 34. D) 35. Show Answer Correct Answer: D) 35. 3. What output will this code produce? A) ['France', 'Wales', 'England']France. B) France Wales EnglandFrance. C) France, Wales, EnglandWales. D) ['France', 'Wales', 'England']Wales. Show Answer Correct Answer: D) ['France', 'Wales', 'England']Wales. 4. What does the '#' allow you to do? A) Comment on code. B) Repeat code. C) End code. D) Print code. Show Answer Correct Answer: A) Comment on code. 5. Which one of the following is the correct way of calling a function? A) Function name(). B) Call function name(). C) Ret function name(). D) Function function name(). Show Answer Correct Answer: A) Function name(). 6. In Python, list is mutable A) False. B) True. C) All the above. D) None of the above. Show Answer Correct Answer: B) True. 7. If, else and elif is used for ..... A) Iteration. B) Selection. C) Printing. D) Indentation. Show Answer Correct Answer: B) Selection. 8. The result of this program:Friday = Falseif Friday:print "Jeans day!"else:print "Uniform day" A) Not Friday. B) Today is Friday. C) Jeans day. D) Uniform day. Show Answer Correct Answer: D) Uniform day. 9. In Python, iteration is another word for a: A) Loop. B) Variable. C) Function. D) Command. Show Answer Correct Answer: A) Loop. 10. What will be the output?names1 = ['Amir', 'Bala', 'Chales']if 'amir' in names1:print(1) else:print(2) A) None. B) 1. C) 2. D) Error. Show Answer Correct Answer: C) 2. 11. An expression is A) A set of steps for performing a task, like a recipe. B) An ordered list of values or objects. C) To combine two strings of text into a single string. D) Any valid set of values, variables, operators, and functions that produces a value or result. Show Answer Correct Answer: D) Any valid set of values, variables, operators, and functions that produces a value or result. 12. What method is used to remove the first occurrence of a specific value from a list in Python? A) Remove(). B) Pop(). C) Delete(). D) Clear(). Show Answer Correct Answer: A) Remove(). 13. The help statement display ..... from a module. A) Classes. B) Docstrings. C) Functions. D) Constants. Show Answer Correct Answer: B) Docstrings. 14. What is the output of the following lines of code?var1 = 12var1 = 23.4var1 = "I love AI!"print(var1) A) 23.4. B) Error. C) I love AI!. D) 12. Show Answer Correct Answer: C) I love AI!. 15. What can we use to get the first character of a string txt= "Banana" A) X=txt(0). B) X=txt[0]. C) X=txt(1). D) X=txt[1]. Show Answer Correct Answer: B) X=txt[0]. 16. True or False:phone.number is a good name for a variable. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 17. What is used to print the length of a string A) Type.legth(). B) Len(). C) Fulllength(). D) Length(). Show Answer Correct Answer: B) Len(). 18. Which logical operator is used to combine two conditions and returns True if both conditions are True? A) And. B) Xor. C) Not. D) Or. Show Answer Correct Answer: A) And. 19. Choose the correct data type:"Resolution" A) Integer. B) Boolean. C) String. D) Real/Float. E) Character. Show Answer Correct Answer: C) String. 20. In the following code, what type of variable is being created?foo = "bar" A) Integer. B) Float. C) String. D) None of the above. Show Answer Correct Answer: C) String. 21. Read the following Python code carefully and point out the global variables?y, z = 1, 2def f():global x x = y+z A) X. B) Y and z. C) X, y and z. D) Neither x, nor y, nor z. Show Answer Correct Answer: C) X, y and z. 22. What is the position of the name 'Paula' in the following list:names = ["Paul", "Phillip", "Paula", "Phillipa"] A) 1. B) 3. C) 0. D) 2. Show Answer Correct Answer: D) 2. 23. Identify the data type of T:T = ['A', '23', '92', '(10, 20)'] A) Dictionary. B) String. C) Tuple. D) List. Show Answer Correct Answer: C) Tuple. 24. What will happen when we run this:Yourname = input()print ("Hi there, ", yourname) A) It will output Hi there, and the name entered. B) There is an error because there is nothing between the brackets on the input so the user can't input anything as they won't know what to enter. C) There is an error because the variables aren't named the same. D) It will output Hi there, your name. Show Answer Correct Answer: C) There is an error because the variables aren't named the same. 25. Which of the following is an acceptable variable name? A) No text. B) 8text. C) No text$. D) No-text. Show Answer Correct Answer: A) No text. 26. What would be the output of the following code:for i in range(3):print(5) A) 0 1 2 3 4. B) 3 3 3 3 3. C) 5 5 5. D) 0 1 2. Show Answer Correct Answer: C) 5 5 5. 27. All keyword in python are in A) Lower case. B) Upper case. C) Lower case and uppercase. D) None of the above. Show Answer Correct Answer: A) Lower case. 28. In order to move the turtle 120 forward without drawing on the screen, which order is correct? A) Turtle.forward(120)turtle.penup()turtle.pendown(). B) Turtle.pendown()turtle.forward(120)turtle.penup(). C) Turtle.penup()turtle.forward(120)turtle.pendown(). D) None of the above. Show Answer Correct Answer: C) Turtle.penup()turtle.forward(120)turtle.pendown(). 29. Which of the following does not work in Lists? A) Slicing. B) Membership operators. C) Lstrip & rstrip. D) + & * symbol. Show Answer Correct Answer: C) Lstrip & rstrip. 30. What can a variable not start with? A) A lower case letter. B) A number. C) A special character. D) A capital letter. Show Answer Correct Answer: B) A number. 31. In order to store values in terms of key and value we use what core data type. A) Set. B) Tuple. C) List. D) Dict. Show Answer Correct Answer: D) Dict. 32. In the following code, what type of variable is being created?foo = 3.5 A) Integer. B) Float. C) String. D) None of the above. Show Answer Correct Answer: B) Float. 33. What is the output of the following range() function?for num in range(2, -5, -1):print(num, end=", ") A) 0. B) 2, 1, 0, -1, -2, -3, -4, -5. C) 2, 1, 0, -1, -2, -3, -4. D) 2, 1, 0. Show Answer Correct Answer: C) 2, 1, 0, -1, -2, -3, -4. 34. 4 is 100 in binary and 11 is 1011. What is the output of the following bitwise operators? a = 4b = 11print(a | b)print(a >> 2) A) 15 1. B) 14 1. C) All the above. D) None of the above. Show Answer Correct Answer: A) 15 1. 35. Is the following piece of code valid?>>> a=(1, 2, 3, 4)>>> del a A) No, invalid syntax for del method. B) Yes, the entire tuple is deleted. C) Yes, first element in the tuple is deleted. D) No because tuple is immutable. Show Answer Correct Answer: B) Yes, the entire tuple is deleted. 36. What kind of expression must be used as part of the "while" loop statement? A) Mathematical expression. B) Assignment statement. C) Logical expression. D) All of these will work. Show Answer Correct Answer: C) Logical expression. 37. What Python command is used to output text to the screen? A) Int(). B) Print(). C) Display(). D) Input(). Show Answer Correct Answer: B) Print(). 38. What data value would store the value:9? A) String. B) Integer. C) Boolean. D) Float. Show Answer Correct Answer: B) Integer. 39. Python uses ..... to define program blocks. A) Curly braces. B) Delimiter. C) Whitespace. D) Escape sequence. Show Answer Correct Answer: C) Whitespace. 40. What will the output be from the following code?print(9/3*2+4-5) A) 19. B) 5. C) 5.0. D) 0.5. Show Answer Correct Answer: C) 5.0. 41. A variable is a named value that can be changed in the program. A) False. B) True. C) All the above. D) None of the above. Show Answer Correct Answer: B) True. 42. What computer science concept stores information to be used later? A) Loop. B) Variable. C) Function. D) Conditional. Show Answer Correct Answer: B) Variable. 43. This statement is used to evaluate only one condition A) IF STATEMENT. B) IF-ELSE STATEMENT. C) IF-ELIF-ELSE STATEMENT. D) None of the above. Show Answer Correct Answer: A) IF STATEMENT. 44. What is the output of the following piece of code?class Test:def ..... init ..... (self):self.x = 0class Derived ..... Test(Test):def ..... init ..... (self):Test ..... init ..... (self) self.y = 1def main():b = Derived ..... Test() print(b.x, b.y)main() A) 0 1. B) 0 0. C) Error, the syntax of the invoking method is wrong. D) Error because class B inherits A but variable x isn't inherited. Show Answer Correct Answer: A) 0 1. 45. What type of loop do you use to loop through a list? A) Forever. B) While true. C) For in. D) Do while. Show Answer Correct Answer: C) For in. 46. We need import turtle at the top of the code to use Python turtle? A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 47. What is the output of the followingaList = [5, 10, 15, 25]print(aList[::-2]) A) [15, 10, 5]. B) [10, 5]. C) [25, 10]. D) None of the above. Show Answer Correct Answer: C) [25, 10]. 48. 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. 49. 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]. 50. To repeat a fixed number of times use a A) Indentation. B) If loop. C) While loop. D) For loop. Show Answer Correct Answer: D) For loop. 51. 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(9):print(i). C) For i in range(3, 9):print(i). D) For i in range(3, 9, 2):print(i). Show Answer Correct Answer: A) For i in range(3, 10, 2):print(i). 52. Which keyword is used to display output in Python? A) Input. B) Print. C) Output. D) Display. Show Answer Correct Answer: B) Print. 53. 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. 54. What is the output of program below?motorcycles = ['honda', 'yamaha', 'suzuki']motorcycles.sort()print(motorcycles) A) ['honda', 'yamaha', 'suzuki']. B) ['yamaha', 'suzuki', 'honda']. C) ['suzuki', 'yamaha', 'honda']. D) ['honda', 'suzuki', 'yamaha']. Show Answer Correct Answer: D) ['honda', 'suzuki', 'yamaha']. 55. 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". 56. 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. 57. Identify the code that properly creates an instance of a class named Car. A) Camero.car(make, model). B) Mustang = Car(make, model). C) Tesla = car.make(). D) Porsche = car.make.model(). Show Answer Correct Answer: B) Mustang = Car(make, model). 58. 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. 59. Which of the following programs prints ten lines? A) For i from 0 to 9:print("hi"). B) For i = 1 to 10:print("hi"). C) For i in 1-10:print("hi"). D) For i in range(10):print("hi"). Show Answer Correct Answer: D) For i in range(10):print("hi"). 60. 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) 24. B) 23. C) An error message. D) Age. Show Answer Correct Answer: C) An error message. ← 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 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 8 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books