This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 14 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 14 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Which of the following is a list in Python? A) (1, 2, 3). B) \{1, 2, 3\}. C) [1, 2, 3]. D) <1, 2, 3>. Show Answer Correct Answer: C) [1, 2, 3]. 2. What is PEP 8 in Python? A) PEP 8 is a tool for debugging Python code. B) PEP 8 is a Python library for data analysis. C) PEP 8 is the Python Enhancement Proposal that outlines the style guide for Python code. D) PEP 8 is a version of Python released in 2020. Show Answer Correct Answer: C) PEP 8 is the Python Enhancement Proposal that outlines the style guide for Python code. 3. What is a variable defined inside a function referred to as? A) A global variable. B) A volatile variable. C) A local variable. D) An automatic variable. Show Answer Correct Answer: C) A local variable. 4. What data type is the variable result in the following code?result = 10 + 2.5 A) Integer. B) String. C) Floating Point. D) Boolean. Show Answer Correct Answer: C) Floating Point. 5. What will print(2 / 0) output? A) 0. B) Infinity. C) Error. D) None. Show Answer Correct Answer: C) Error. 6. What will be the output of the following code? "'pythonx = 3y = 4if x > 2 and y < 5:print("Yes")else:print("No") "' A) Yes. B) No. C) Error. D) 3. Show Answer Correct Answer: A) Yes. 7. The print() function can be used to add numbers only. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 8. Select the correct input command below A) Input(. B) Input(" . C) Input(" "). D) Input. Show Answer Correct Answer: C) Input(" "). 9. What is the output of the following code? print(type(10)) A) . B) . C) . D) . Show Answer Correct Answer: B) . 10. What type of language is Python? A) Scripting language for web development. B) Low-level, compiled programming language. C) High-level, interpreted programming language. D) Markup language for data presentation. Show Answer Correct Answer: C) High-level, interpreted programming language. 11. What will be the output of the following code? "'pythonif 3 > 2:print("Yes")else:print("No") "' A) Yes. B) No. C) Error. D) None. Show Answer Correct Answer: A) Yes. 12. A Python data type that holds positive and negative whole numbers A) String. B) Int. C) Str. D) Input. Show Answer Correct Answer: B) Int. 13. What is the output of the following code? "'pythonx = "Python"print(x[0]) "' A) P. B) Y. C) T. D) N. Show Answer Correct Answer: A) P. 14. Which one is Karel command? A) TurnLeft. B) Turn Left. C) Turn left(). D) Turn right(). Show Answer Correct Answer: C) Turn left(). 15. What are some popular programming languages mentioned? A) Python, Java, C++. B) Ruby, Swift, Go. C) HTML, CSS, JavaScript. D) PHP, SQL, Perl. Show Answer Correct Answer: A) Python, Java, C++. 16. What happens during the program compilation process? A) The program is converted from human-readable code to machine-readable code. B) The program is converted from machine code to human-readable code. C) The program is stored in a database. D) The program is run directly without any changes. Show Answer Correct Answer: A) The program is converted from human-readable code to machine-readable code. 17. What is the output of the following code?x = 5if x > 3:passelse:print("Hello") A) Hello. B) No output. C) Error. D) None. Show Answer Correct Answer: B) No output. 18. What is the purpose of comments in Python? A) The purpose of comments in Python is to explain code and improve readability. B) To create new functions. C) To execute code faster. D) To store variables temporarily. Show Answer Correct Answer: A) The purpose of comments in Python is to explain code and improve readability. 19. A statement in programming A) Expresses an action to be carried out. B) Always returns results like expressions. C) Rules controlling how components in a program are combined. D) An instruction to perform a task, usually one word. Show Answer Correct Answer: A) Expresses an action to be carried out. 20. Where was Guido van Rossum born? A) Silicon Valley. B) Haarlem, the Netherlands. C) Hollywood. D) New York City. Show Answer Correct Answer: B) Haarlem, the Netherlands. 21. What does len([1, 2, 3]) return? A) 3. B) 2. C) 1. D) Error. Show Answer Correct Answer: C) 1. 22. What does the 'pop()' method do in a list? A) Sorts the list. B) Adds an element to the list. C) Returns the first element of the list. D) Removes the last element from the list. Show Answer Correct Answer: D) Removes the last element from the list. 23. In Python, ..... does not copy a value; it just attaches a name to the object that contains the data. A) Variable. B) Application. C) Allocation. D) Assignment. Show Answer Correct Answer: D) Assignment. 24. What is the traditional implementation of Python called? A) Python C. B) CPython. C) Python PSF. D) Guido Python. Show Answer Correct Answer: B) CPython. 25. What does the 'continue' statement do in a loop? A) It restarts the loop from the beginning. B) It pauses the loop for a specified time. C) It skips the current iteration and continues with the next one. D) It exits the loop completely. Show Answer Correct Answer: C) It skips the current iteration and continues with the next one. ← PreviousNext →Related QuizzesClass 11 Computer Science Chapter 2 Introduction To Python Quiz 1Class 11 Computer Science Chapter 2 Introduction To Python Quiz 2Class 11 Computer Science Chapter 2 Introduction To Python Quiz 3Class 11 Computer Science Chapter 2 Introduction To Python Quiz 4Class 11 Computer Science Chapter 2 Introduction To Python Quiz 5Class 11 Computer Science Chapter 2 Introduction To Python Quiz 6Class 11 Computer Science Chapter 2 Introduction To Python Quiz 7Class 11 Computer Science Chapter 2 Introduction To Python Quiz 8Class 11 Computer Science Chapter 2 Introduction To Python Quiz 9Class 11 Computer Science Chapter 2 Introduction To Python Quiz 10 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books