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 3 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 3 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. This is a catch-all for every other situation besides the one where the condition is true. A) Else. B) Do. C) Then. D) If. Show Answer Correct Answer: A) Else. 2. Exponent operator ** has (a) associativity in Python. A) Bottom-to-top. B) Left-to-right. C) A. right-to-left. D) Top-to-bottom. Show Answer Correct Answer: C) A. right-to-left. 3. What does built-in function type do in context of classes? A) Determines class description of any value. B) Determines the class name of any value. C) Determines the file name of any value. D) Determines the object name of any value. Show Answer Correct Answer: B) Determines the class name of any value. 4. Logical operators:True if both operands are true A) X and y. B) X or y. C) Not x. D) None of the above. Show Answer Correct Answer: A) X and y. 5. What is the output of the following code?def calculate (num1, num2=4):res = num1 * num2print(res)calculate(5, 6) A) 20. B) The program executed with errors. C) 30. D) None of the above. Show Answer Correct Answer: C) 30. 6. S1="Hello"n1=10print(s1+n1)What is the error in this code? A) Colon not written after the print statement. B) Numeric value not written in quotes. C) String cannot be added to a number. D) Print statement not written in quotes. Show Answer Correct Answer: C) String cannot be added to a number. 7. Which of the following is a feature of Python DocString? A) In Python all functions should have a docstring. B) It provides a convenient way of associating documentation with Python modules, functions, classes, and methods. C) Docstrings can be accessed by the doc attribute on objects. D) All of the mentioned. Show Answer Correct Answer: D) All of the mentioned. 8. Suppose you have the following tuple definition:t = ('foo', 'bar', 'baz')Which of the following statements replaces the second element ('bar') with the string 'qux': A) T[1] = 'qux'. B) T[1:1] = 'qux'. C) Error. D) T(1) = 'qux'. Show Answer Correct Answer: C) Error. 9. What syntax would you use to create a name variable? A) Name=input{}. B) Name=input(). C) Name=INPUT. D) Input=name. Show Answer Correct Answer: B) Name=input(). 10. Which of the following is true about if-elif-else statements? A) After using if, an elif can be added as an additional test. B) The bodies of multiple elif's can run. C) You can use an elif without an if. D) Code in an else body runs if all the tests before it were True. Show Answer Correct Answer: A) After using if, an elif can be added as an additional test. 11. Random.randrange(6) A) 1, 2, 3, 4, 5, 6. B) 0, 1, 2, 3, 4, 5, 6. C) 1, 2, 3, 4, 5. D) 0, 1, 2, 3, 4, 5. Show Answer Correct Answer: D) 0, 1, 2, 3, 4, 5. 12. Fixing errors in programming is called ..... A) Looping. B) Optimization. C) Debugging. D) Cleaning. Show Answer Correct Answer: C) Debugging. 13. Which word completes this sentence: "Iteration makes code more ..... " A) Complex. B) Efficient. C) Simple. D) Straightforward. Show Answer Correct Answer: B) Efficient. 14. Which one of the following is correct way of declaring and initializing a variable, x with value 5? A) Declare x=5. B) Int xx=5. C) X=5. D) Int x=5. Show Answer Correct Answer: C) X=5. 15. What key word is does this define?A container used to store a value A) Variable. B) Algorithm. C) Casting. D) String. Show Answer Correct Answer: A) Variable. 16. Look at the following code:name = input ("What is your name? ")name = input ("What is your age? ")print (name)If the user answered "John" to the first question and "23" to the second, what will be printed? A) John. B) Name. C) An error message. D) 23. Show Answer Correct Answer: D) 23. 17. Which code would i use to add an item to a list? A) Append.variable(). B) Variable.append(). C) Variable.add(). D) Add.variable(). Show Answer Correct Answer: B) Variable.append(). 18. ..... data type contain integer values with decimal such as 10.1, 5555.0, 33.33 etc. A) Char. B) Float. C) Int. D) String. Show Answer Correct Answer: B) Float. 19. How is a code block indicated in Python? A) Bracket. B) Indentation. C) Key. D) None of the above. Show Answer Correct Answer: B) Indentation. 20. Select the correct answer:x = 15y = 4print(x // y) A) 5. B) 3.75. C) 4. D) 3. Show Answer Correct Answer: D) 3. 21. Clara is writing a program that will print out the first ten numbers of a times table (chosen by the user). Should she use ..... A) A FOR loop. B) A WHILE loop. C) All the above. D) None of the above. Show Answer Correct Answer: A) A FOR loop. 22. L ..... names=['Harsh', 'Amit', 'Sahil', 'Viresh']L ..... names.pop() A) 'Harsh'. B) 'Amit'. C) 'Viresh'. D) None of the above. Show Answer Correct Answer: C) 'Viresh'. 23. Variable.sort() will do what? A) Create a new list. B) Sort the list into alphabetical order. C) Error. D) Sort the list into reverse order. Show Answer Correct Answer: B) Sort the list into alphabetical order. 24. Exception disrupts the A) Normal flow of the program. B) Abnornal flow of the program. C) Hard Disk. D) None of the Above. Show Answer Correct Answer: A) Normal flow of the program. 25. In Python the multiplication sign is ..... A) '. B) *. C) %. D) . Show Answer Correct Answer: B) *. 26. What is the output of the following loop:-for l in 'Jhon':if l == 'o':pass print(l, end=", ") A) J, h, n,. B) J, h, o, n,. C) Error. D) None of the given Options. Show Answer Correct Answer: B) J, h, o, n,. 27. ..... is information the user sends to the computer A) Input. B) Software. C) Secondary Memory. D) Program. Show Answer Correct Answer: A) Input. 28. Which of the following concepts is not a part of Python? A) Pointers. B) Loops. C) Dynamic typing. D) All of the above. Show Answer Correct Answer: A) Pointers. 29. Look at the following code:Length = 50Width = 30Area = L * Wprint (Area)What is the result of this code? A) 50. B) Area. C) 150. D) An error message. Show Answer Correct Answer: D) An error message. 30. What is the mutable object given below? A) Dict. B) List. C) Tuple. D) Str. Show Answer Correct Answer: B) List. 31. What is the output of program below?bicycles = ['trek', 'cannondale', 'redline', 'specialized']print(bicycles[-1]) A) Redline. B) Cannondale. C) Trek. D) Specialized. Show Answer Correct Answer: D) Specialized. 32. What is printed?cheer = "Go Eagles!"print cheer[:5] A) Go Eag. B) Go. C) Go E. D) Go Ea. Show Answer Correct Answer: D) Go Ea. 33. What will be the output of this code?x = 14y = 13y = x + 3if x<=y:print("Hurray")else:print("Yay") A) Yay. B) 13. C) Hurray. D) 14. Show Answer Correct Answer: C) Hurray. 34. Which of the following is true for a tuple? A) Tup = 1, 2, 3. B) Tup = (""1, "2). C) Tup = (1, 2, 3, 4). D) None of the above. Show Answer Correct Answer: C) Tup = (1, 2, 3, 4). 35. What is the syntax to check if two values are equal in Python? A) =. B) ==. C) ===. D) Is. Show Answer Correct Answer: B) ==. 36. A while loop can be used in which of the following situations? A) Repeat a set of statements till a condition remains True. B) Repeat a set of statements a finite or an infinite number of times. C) Iterate through a string, list, and tuple. D) All of the above. Show Answer Correct Answer: D) All of the above. 37. There can be an else statement without an if statement A) FALSE. B) TRUE. C) All the above. D) None of the above. Show Answer Correct Answer: A) FALSE. 38. Is a list in Python mutable or immutable? A) Mutable. B) Dynamic. C) Immutable. D) Fixed. Show Answer Correct Answer: A) Mutable. 39. "AB-CD-EF" .partition('-'), the function returns the output A) ('ABCD', '-', 'EF'). B) ('AB', '-', 'CDEF'). C) ('AB', '-', 'CD-EF'). D) None of the above. Show Answer Correct Answer: C) ('AB', '-', 'CD-EF'). 40. Identify the initialization method for a Car class. A) Class init(self, make, model):. B) Def init (self, make, model):. C) Class init :. D) Def init (self, make, model):. Show Answer Correct Answer: B) Def init (self, make, model):. 41. What is the result of the following code?x = "Hello"print(bool(x)) A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 42. To display something on the screen, use this command: A) Write(). B) Display(). C) Print(). D) Screen(). E) Print(). Show Answer Correct Answer: C) Print(). 43. Print(boolean(None, "String", False, "False", 0, "value")What is the output? A) False, True, True, False, False, True. B) False, True, False, True, False, True. C) True, True, False, False, True, False. D) False, False, True, True, False, True. Show Answer Correct Answer: B) False, True, False, True, False, True. 44. Which of the following statements will cause a "while" loop to immediately exit without running any more statements in the body or checking the logical expression again? A) Break. B) Continue. C) Else. D) Stop. Show Answer Correct Answer: A) Break. 45. What will be the output of the following code?def fn1(c=10):print(c) fn1(4)fn1() A) 4 4. B) 10 4. C) 4 10. D) 10 10. Show Answer Correct Answer: C) 4 10. 46. Data type that can only be true or false A) String. B) Float. C) Boolean. D) Int. Show Answer Correct Answer: C) Boolean. 47. ..... is a data type that contain a set of characters (letters, symbols, etc.) E.g. "Hello", "Ali", "Car Type" A) Float. B) String. C) Int. D) Char. Show Answer Correct Answer: B) String. 48. Converts a number to a string A) Convert. B) Str(). C) ParseInt(). D) Int(). Show Answer Correct Answer: B) Str(). 49. Which of these is NOT a loop in python? A) For loop. B) Nested loop. C) While loop. D) If loop. Show Answer Correct Answer: D) If loop. 50. If you wished a loop to repeat 3 types whwt should you use? A) For counter in range(0, 5):. B) For counter in range(1.3):. C) For counter in range(0.3):. D) None of the above. Show Answer Correct Answer: C) For counter in range(0.3):. 51. What is missing from this input statement?input ("What is your name? ") A) A variable to store the input. B) An output. C) Print =. D) The answer. Show Answer Correct Answer: A) A variable to store the input. 52. When you want to hide the turtle pointer on the screen which command should you use? A) Remove turtle( ). B) Hide turtle( ). C) Turtle.disappear( ). D) Hideturtle( ). Show Answer Correct Answer: D) Hideturtle( ). 53. The objects that the variable refers to A) While loop. B) Method. C) Value. D) Syntax. Show Answer Correct Answer: C) Value. 54. Pieces of code that only run "under certain conditions": A) Syntax. B) Control flow statments. C) Conditional statements. D) Variables. Show Answer Correct Answer: C) Conditional statements. 55. Which operator is known as ternary operator in python? A) Comparative. B) Relational. C) Conditional. D) Assignment. Show Answer Correct Answer: C) Conditional. 56. Which keyword is used for an infinite loop or ITERATION? A) While True:. B) Else. C) Elif. D) If answer == "right":. Show Answer Correct Answer: A) While True:. 57. The data structure which is a mutable ordered sequence of elements is called A) Tuple. B) Built in. C) List. D) Derived data. Show Answer Correct Answer: C) List. 58. What is the correct term for this symbol?" '' A) Parenthesis. B) Quotation marks. C) Bunny fingers. D) Exclamation mark. Show Answer Correct Answer: B) Quotation marks. 59. Which is known as simple assignment operator? A) ==. B) #. C) +=. D) =. Show Answer Correct Answer: D) =. 60. What does this code do? print("Hello world!") A) Displays 'hello, world.' in the shell window. B) Waits for the user to type in 'Hello world!'. C) Sends 'Hello world!' to the printer. D) Displays 'Hello world!' in the shell window. Show Answer Correct Answer: D) Displays 'Hello world!' in the shell window. ← 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 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