This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 36 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 36 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Which line of code will display the message 'Hello World!' on the screen when it is run in Python? A) Display ("Hello World"). B) Output ("Hello World"). C) Print ("Hello World!"). D) Print "Hello World!". Show Answer Correct Answer: C) Print ("Hello World!"). 2. Which keyword is used for decision making? A) If. B) Loop. C) Print. D) Return. Show Answer Correct Answer: A) If. 3. How do you take input from the user? A) Input (). B) Scanf (). C) Console (). D) All of the above. Show Answer Correct Answer: A) Input (). 4. A disadvantage of Python is it is harder to debug than other higher level programming languages. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 5. Which operator checks if two values are not equal in Python? A) ==. B) !=. C) <. D) >=. Show Answer Correct Answer: B) !=. 6. What are python comments? A) Line of comments are ignored when writing code in python. B) Line of comments are not ignored when writing code in python. C) Line of comments are not in words when writing code in python. D) Line of comments are ignored when writing code in python. Show Answer Correct Answer: A) Line of comments are ignored when writing code in python. 7. What is the name of the programming language we are learning? A) Scratch. B) Python. C) Monty Python. D) Turtle. Show Answer Correct Answer: B) Python. 8. What is the output of the expression 8 * 2 in Python? A) 16. B) 14. C) 12. D) 18. Show Answer Correct Answer: A) 16. 9. Which of the following is NOT a type of variable in Python? A) Local variable. B) Output variable. C) Global variable. D) Static variable. Show Answer Correct Answer: D) Static variable. 10. Tuples in Python have a limited set of methods. Which statement is accurate? A) They include sort and extend methods. B) They have dozens of mutation methods. C) They only provide count and index. D) They support append and remove too. Show Answer Correct Answer: C) They only provide count and index. 11. Which of the following is a correct way to start a comment in Python? A) '// This is a comment'. B) '# This is a comment'. C) '/* This is a comment */'. D) ". Show Answer Correct Answer: B) '# This is a comment'. 12. Why Python is in demand? A) Simple syntax. B) Useful in embedded and cross platforms. C) It is the fastest performing programming language. D) It has fewer libraries. Show Answer Correct Answer: A) Simple syntax. 13. Which of the following is NOT a built-in data type in Python? A) List. B) Tuple. C) Set. D) Array. Show Answer Correct Answer: D) Array. 14. What is printed by the following statement?print("A" in "APCSP") A) True. B) False. C) Error. D) None of the above. Show Answer Correct Answer: A) True. 15. What will be the output of the following code?my ..... dict = \{'name':'Alice', 'age':25\}print(my ..... dict['name']) A) Alice. B) 25. C) Name. D) Error. Show Answer Correct Answer: A) Alice. 16. What is string concatenation used for? A) Turning text into a number. B) Joining text and variables to make a longer message. C) Checking if two values match. D) Making a variable permanent. Show Answer Correct Answer: B) Joining text and variables to make a longer message. 17. What data type is 12.0? A) String. B) Int. C) Float. D) Boolean. Show Answer Correct Answer: C) Float. 18. The instructions in a program ..... A) Can be expressed in any language. B) Can be expressed in any language, as long as they are precise. C) Can only be expressed using a programming language. D) Can only be expressed using binary digits. Show Answer Correct Answer: C) Can only be expressed using a programming language. 19. What is the output of the following code?name = input("Enter your name: ")print("Hello, '' + name + "!")(Assume the user enters "Alice") A) Hello, Alice. B) Hello, Alice!. C) Hello Alice. D) Hello Alice!. Show Answer Correct Answer: B) Hello, Alice!. 20. What is the correct way to declare a variable in Python? A) 'var x = 10'. B) 'x = 10'. C) 'int x = 10'. D) 'declare x = 10'. Show Answer Correct Answer: B) 'x = 10'. 21. Which is NOT a legal variable name? A) My-var = 20. B) My var = 20. C) Myvar = 20. D) Myvar = 20. Show Answer Correct Answer: A) My-var = 20. 22. Why is else placed at the end of an if-elif-else chain? A) It repeats earlier conditions. B) It catches any unmatched case. C) It runs before all checks. D) It stops the program immediately. Show Answer Correct Answer: B) It catches any unmatched case. 23. You receive data as a list:data = [9, 2, 9]. Which single call turns it into an immutable sequence? A) Data.sort() makes a tuple. B) Sorted(data) makes a tuple. C) List(data) makes a tuple. D) Tuple(data) makes a tuple. Show Answer Correct Answer: D) Tuple(data) makes a tuple. 24. A line of text that Python won't try to run as code A) Integer. B) Comment. C) Strings. D) Input. Show Answer Correct Answer: B) Comment. 25. What is Python commonly used for in AI? A) Python is primarily used for web development. B) Python is mainly used for game design. C) Python is often used for graphic design. D) Python is commonly used for machine learning, data analysis, and building AI applications. Show Answer Correct Answer: D) Python is commonly used for machine learning, data analysis, and building AI applications. ← 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