This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 9 Practical Work Python Exercises – Quiz 16 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 16 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What is a variable defined outside a function referred to as? A) Local variable. B) Global variable. C) Static variable. D) Automatic variable. Show Answer Correct Answer: B) Global variable. 2. Str="world of python programming"print(str[0:5]) A) World. B) Word. C) Wold. D) Wolrd. Show Answer Correct Answer: A) World. 3. In python the ' BOOLEAN data type' can be defined as ..... ? A) Holds alphanumerical data. B) Holds whole numbers. C) Holds a number with a decimal point. D) Holds either true or false. Show Answer Correct Answer: D) Holds either true or false. 4. Any statements inside an IF clause (section) can be executed multiple times. A) FALSE. B) TRUE. C) All the above. D) None of the above. Show Answer Correct Answer: A) FALSE. 5. Repeat a block of code while a certain condition is true (they do not go on forever). A) Loop. B) While loop. C) Infinite loop. D) Syntax. Show Answer Correct Answer: B) While loop. 6. If foo is equal to 'bar', what is the value of foo after this operation?foo += 3 A) Nothing, that operation will throw an error. B) Bar3. C) 3bar. D) None of the above. Show Answer Correct Answer: A) Nothing, that operation will throw an error. 7. Which of the following allow to name the various parts of a multi-item object? A) Tuples. B) Lists. C) Classes. D) Quadrats. Show Answer Correct Answer: C) Classes. 8. ..... data type 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. What is the output of the following code:print 5//2 A) 2. B) 2.5. C) 0. D) Error. Show Answer Correct Answer: A) 2. 10. In Python, a variable needs to A) Start with a lower case letter. B) Be stated before "print". C) Have % symbols on either side. D) Variable????? We don't need variables!!!!. Show Answer Correct Answer: A) Start with a lower case letter. 11. What is displayed on the screen when the following code runs? esports = ["Donkey Kong", "Galaga", "Pac Man"] if ("Galaga" in esports):print("Found it") else:print("Not here") A) Both "Found it" and "Not here". B) Not here. C) Nothing-there is no output at all. D) Found it. Show Answer Correct Answer: D) Found it. 12. What data type represents characters? A) Float. B) Int. C) Boolean. D) String. Show Answer Correct Answer: D) String. 13. Which of the following assign the value 50 to a variable x? A) X=50. B) Let x=50. C) X;=50. D) X<<50. Show Answer Correct Answer: A) X=50. 14. What are the lines of code called in a program? A) Code. B) Instructions. C) Source Lines of Code. D) Lines of Code. Show Answer Correct Answer: C) Source Lines of Code. 15. Which of the following statements is correct for variable names in Python language? A) All variable names must begin with an underscore. B) Unlimited length. C) The variable name length is a maximum of 2. D) All of the above. Show Answer Correct Answer: B) Unlimited length. 16. What will be the output from the following code?print(17%5) A) 3. B) 3.4. C) 2. D) 12. Show Answer Correct Answer: C) 2. 17. If list=[17, 23, 41, 10] then list.append(32) will result A) [32, 17, 23, 41, 10]. B) [17, 23, 41, 10, 32]. C) [10, 17, 23, 32, 41]. D) [41, 32, 23, 17, 10]. Show Answer Correct Answer: B) [17, 23, 41, 10, 32]. 18. Dictionary keys must be ..... A) Immutable. B) Mutable. C) All the above. D) None of the above. Show Answer Correct Answer: A) Immutable. 19. List items are indexed, the first item has index [1], the second item has index [2] etc. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 20. A sequence of immutable objects is called A) Built in. B) List. C) Tuple. D) Derived data. Show Answer Correct Answer: C) Tuple. 21. What is the maximum possible length of an identifier? A) 31 characters. B) 63 characters. C) 79 characters. D) None of the mentioned. Show Answer Correct Answer: D) None of the mentioned. 22. Which of these commands would successfully create a turtle named Alice A) Alice = turtle.pen(). B) Alice = Turtle.pen(). C) Alice = Turtle.Pen(). D) Alice = turtle.Pen(). Show Answer Correct Answer: D) Alice = turtle.Pen(). 23. When you compare two values, the expression is evaluated and Python returns the Boolean answer. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 24. What can we use to get the characters from index 2 to index 4 (llo) in txt = "Hello, World" A) Optionsx= txt[2:4]. B) X= txt[1:4]. C) X= txt[2:5]. D) X= txt[2:6]. Show Answer Correct Answer: C) X= txt[2:5]. 25. When we create a program to extract each alphabet from a given string, what is it known as? A) Transpose. B) Traverse. C) Translate. D) Terminate. Show Answer Correct Answer: B) Traverse. ← 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 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 10 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books