This quiz works best with JavaScript enabled. Home > Class 11 > 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 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Why do certain words change color in Python? A) To show that they are recognized as key words. B) To tell you that these words cannot be used in Python code. C) To show you that these words can be clicked. D) To tell Python to skip these words when running the code. Show Answer Correct Answer: A) To show that they are recognized as key words. 2. Text to be output to the screen should be enclosed by '' '' A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 3. Str="world of python programming"print(str[::-2]) A) Gimopnhy odrw. B) Gimronhy odrw. C) Gimropnhy odr. D) Gimropnhy odrw. Show Answer Correct Answer: D) Gimropnhy odrw. 4. The following code will stop the loop if i is 3 Fill in the blanks to perform the same i = 1 ..... i < 6:if i == 3:break i += 1 A) Do while. B) For. C) If. D) While. Show Answer Correct Answer: D) While. 5. What will be the data type of num1 if the following code is executed?num1=int('3.14') A) String. B) Int. C) Float. D) Number. Show Answer Correct Answer: B) Int. 6. Find the argument in the following code:hero.moveUp(4) A) Hero. B) MoveUp(). C) 4. D) Up(). Show Answer Correct Answer: C) 4. 7. Which version of Python introduced list comprehensions? A) Python 3.5. B) Python 2.0. C) Python 4.0. D) Python 2.7. Show Answer Correct Answer: B) Python 2.0. 8. ..... is a data type that can represent one of two values either True or False such as 1, 0, 2 > 1, 3 < 2. A) Int. B) Float. C) Char. D) Boolean. Show Answer Correct Answer: D) Boolean. 9. Which statement will check to see if a is equal to b? A) If a == b. B) If a = b:. C) If a != b:. D) If a == b:. Show Answer Correct Answer: D) If a == b:. 10. What is the output of the code?a = (33, 55)a.append(22)print(a) A) 33 55 22. B) 335522. C) 33, 55, 22. D) Error. Show Answer Correct Answer: D) Error. 11. Who created Python programming language? A) Guido van Rossum. B) Mia Daniels. C) Binod. D) Dennis Ritchie. Show Answer Correct Answer: A) Guido van Rossum. 12. Which one of the following has the highest precedence in the expression? A) Addition. B) Multiplication. C) Exponential. D) ParenthesIs. Show Answer Correct Answer: D) ParenthesIs. 13. What is concatenation? A) Replacing a string variable with another string variable. B) Combining two variables such as first name and last name. C) One of the food options in the canteen on Friday. D) A large collection of cats in an open space. Show Answer Correct Answer: B) Combining two variables such as first name and last name. 14. What keyword do you use to start a function? A) Function. B) Def. C) In. D) Key. Show Answer Correct Answer: B) Def. 15. What type of inheritance is illustrated in the following piece of code?class A():passclass B():passclass C(A, B):pass A) Multi-level inheritance. B) Multiple inheritance. C) Hierarchical inheritance. D) Single-level inheritance. Show Answer Correct Answer: B) Multiple inheritance. 16. The Python keywords/commands "break" and "continue" can be used in other structures (such as IF statements) as well as in loops. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 17. Which of the following symbols is used in Python to mean "Less than or equal to" ? A) <<. B) =<. C) <=. D) !=. Show Answer Correct Answer: C) <=. 18. If a function doesn't have a return statement, which of the following does the function return? A) Int. B) Null. C) None. D) An exception is thrown without the return statement. Show Answer Correct Answer: C) None. 19. A variable that is defined inside a method and belongs only to the current instance of a class is known as? A) Inheritance. B) Instance variable. C) Function overloading. D) Instantiation. Show Answer Correct Answer: B) Instance variable. 20. Why is it difficult to find pythons in the Florida swamps? A) The pythons are very fast. B) All of the above. C) The terrain is challenging to navigate. D) The pythons camouflage well. Show Answer Correct Answer: B) All of the above. 21. Leo wants to create a subroutine that will roll a dice. Which syntax is correct? A) Def dice roll ():. B) Def diceroll (). C) Def diceroll ():. D) Def diceroll []:. Show Answer Correct Answer: C) Def diceroll ():. 22. Which one of the following have the highest precedence in the expression? A) Exponential. B) Addition. C) Parentheses. D) Multiplication. Show Answer Correct Answer: C) Parentheses. 23. Which operator checks if a value is not equal to another value? A) ==. B) +=. C) !=. D) =. Show Answer Correct Answer: C) !=. 24. Else if (elif) is used in which situation? A) If the previous conditions were not true. B) You can use if statement to replace elif. C) Else is enough for now. D) Any situation. Show Answer Correct Answer: A) If the previous conditions were not true. 25. What is the output of the following code?var1 = 1var2 = 2var3 = "3"print(var + var2 + var3) A) 6. B) 33. C) 123. D) ERROR. Show Answer Correct Answer: D) ERROR. ← PreviousNext →Related 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 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