This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 9 Practical Work Python Exercises – Quiz 6 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 6 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Exponent operator ** has (a) associativity in Python. A) A. right-to-left. B) Left-to-right. C) Top-to-bottom. D) Bottom-to-top. Show Answer Correct Answer: A) A. right-to-left. 2. What does built-in function type do in context of classes? A) Determines the object name of any value. B) Determines the class name of any value. C) Determines class description of any value. D) Determines the file name of any value. Show Answer Correct Answer: B) Determines the class name of any value. 3. 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. 4. 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. 5. S1="Hello"n1=10print(s1+n1)What is the error in this code? A) Print statement not written in quotes. B) Numeric value not written in quotes. C) Colon not written after the print statement. D) String cannot be added to a number. Show Answer Correct Answer: D) String cannot be added to a number. 6. 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. 7. 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) = 'qux'. C) T[1:1] = 'qux'. D) Error. Show Answer Correct Answer: D) Error. 8. What syntax would you use to create a name variable? A) Name=input(). B) Input=name. C) Name=input\{\}. D) Name=INPUT. Show Answer Correct Answer: A) Name=input(). 9. 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. 10. Random.randrange(6) A) 0, 1, 2, 3, 4, 5, 6. B) 1, 2, 3, 4, 5, 6. C) 0, 1, 2, 3, 4, 5. D) 1, 2, 3, 4, 5. Show Answer Correct Answer: C) 0, 1, 2, 3, 4, 5. 11. Comparison Operators:Select the correct operator for Greater than or Equal to: A) >=. B) =>. C) =). D) <=. Show Answer Correct Answer: A) >=. 12. Fixing errors in programming is called ..... A) Optimization. B) Debugging. C) Looping. D) Cleaning. Show Answer Correct Answer: B) 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) Int xx=5. B) Int x=5. C) X=5. D) Declare 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) Casting. B) String. C) Variable. D) Algorithm. Show Answer Correct Answer: C) Variable. 16. Which operator has higher precedence in the following list? A) % Modulus. B) & BitWise AND. C) **, Exponent. D) > Comparison. Show Answer Correct Answer: C) **, Exponent. 17. 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) 23. B) John. C) Name. D) An error message. Show Answer Correct Answer: A) 23. 18. Which code would i use to add an item to a list? A) Variable.add(). B) Variable.append(). C) Append.variable(). D) Add.variable(). Show Answer Correct Answer: B) Variable.append(). 19. ..... data type contain integer values with decimal such as 10.1, 5555.0, 33.33 etc. A) Int. B) Float. C) Char. D) String. Show Answer Correct Answer: B) Float. 20. 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. 21. Select the correct answer:x = 15y = 4print(x // y) A) 3. B) 3.75. C) 4. D) 5. Show Answer Correct Answer: A) 3. 22. 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. 23. 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'. 24. A shell is A) A text-based command line program that reads commands from the user and runs them. B) A file or set of files with related variables, functions, and classes that can be reused in other programs. C) Any data or information entered into a computer. D) A named, reusable set of programming statements to perform a specific task. Show Answer Correct Answer: A) A text-based command line program that reads commands from the user and runs them. 25. Variable.sort() will do what? A) Sort the list into alphabetical order. B) Sort the list into reverse order. C) Create a new list. D) Error. Show Answer Correct Answer: A) Sort the list into alphabetical order. ← 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 4Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 5Class 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