This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 78 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 78 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Used to make comments A) #. B) %. C) **. D) (). Show Answer Correct Answer: A) #. 2. What does the following code do? "'pythonfor i in range(3):print(i) "' A) Prints 1, 2, 3. B) Prints 0, 1, 2. C) Prints 0, 1, 2, 3. D) Prints 3 times. Show Answer Correct Answer: B) Prints 0, 1, 2. 3. What will be the output of the following code:print(5 == 5)? A) False. B) True and False. C) True. D) 5. E) None. Show Answer Correct Answer: C) True. 4. Which construct lets Python choose among more than two paths? A) Only if and else. B) If with multiple elif. C) Print( ). D) Functions with return. Show Answer Correct Answer: B) If with multiple elif. 5. What will be the output of the following code? "'pythonnumbers = [10, 20, 30]print(numbers[1]) "' A) '10'. B) '20'. C) '30'. D) 'Error'. Show Answer Correct Answer: B) '20'. 6. Which programming language uses loops? A) Python only. B) Scratch only. C) Both Scratch and Python. D) Neither Scratch nor Python. Show Answer Correct Answer: C) Both Scratch and Python. 7. A compiler is a software program that: A) Executes machine code directly. B) Converts high-level code to machine code. C) Translates assembly code to machine code. D) None of the above. Show Answer Correct Answer: B) Converts high-level code to machine code. 8. What is a Constant? A) A storage location of memory which does not change. B) A random area to store things in. C) Something that changes. D) Something that can only store numbers. Show Answer Correct Answer: A) A storage location of memory which does not change. 9. What is the result of the expression 9 * 3 in Python? A) 27. B) 26. C) 28. D) 25. Show Answer Correct Answer: A) 27. 10. Who designed Python? A) Guido van Rossum. B) James Gosling. C) Bjarne Stroustrup. D) Dennis Ritchie. Show Answer Correct Answer: A) Guido van Rossum. 11. Which symbol is used to start a comment in Python? A) //. B) <$\rightarrow$. C) #. D) **. Show Answer Correct Answer: C) #. 12. Which of the following statements will correctly check if a variable 'a' is equal to 10? A) If a = 10:. B) If a == 10:. C) If a === 10:. D) If a equals 10:. Show Answer Correct Answer: B) If a == 10:. 13. What is the purpose of the IDLE interpreter in Python? A) To debug Python code. B) To compile Python code. C) To interpret and run Python code. D) To manage Python packages. Show Answer Correct Answer: C) To interpret and run Python code. 14. What do we use variables for? A) To store data. B) Print data. C) Produce functions. D) None of the above. Show Answer Correct Answer: A) To store data. 15. Which of the following is a float in Python? A) 7. B) "7.0". C) 7.0. D) '7'. Show Answer Correct Answer: C) 7.0. 16. What is the purpose of the 'elif' statement in Python? A) To end a loop. B) To define a function. C) To create a loop. D) To handle multiple conditions. Show Answer Correct Answer: D) To handle multiple conditions. 17. Which statement shows understanding of why tuples are handy in programs? A) They protect contents from accidental changes. B) They allow frequent in-place edits easily. C) They store elements without any order. D) They require more memory than lists always. Show Answer Correct Answer: A) They protect contents from accidental changes. 18. What are keywords in Python? Give an example. A) 'print' is a keyword used for outputting text. B) An example of a keyword in Python is 'def', which is used to define a function. C) 'return' is a keyword that ends a function. D) 'input' is a keyword for taking user input. Show Answer Correct Answer: B) An example of a keyword in Python is 'def', which is used to define a function. 19. Is the result of the following code:print(random.randint(3, 9)) A) 9. B) Prints the word:random. C) 3. D) Prints a random number between 3 & 9. Show Answer Correct Answer: D) Prints a random number between 3 & 9. 20. Which of the following is NOT an example of a high-level programming language? A) Java. B) C++. C) Machine language. D) Kotlin. Show Answer Correct Answer: C) Machine language. 21. What file extension should you use to save a Python script in IDLE? A) .txt. B) .doc. C) .py. D) .java. Show Answer Correct Answer: C) .py. 22. Which of the following is used to create a function in Python? A) Function. B) Create. C) Def. D) Func. Show Answer Correct Answer: C) Def. 23. What will be the output of the following code? "'pythonname = input("Enter your name: ")print("Welcome, '' + name) "'If the user enters 'Alice', what is printed? A) Welcome, Alice. B) Enter your name:Alice. C) Alice Welcome. D) Welcome Alice. Show Answer Correct Answer: A) Welcome, Alice. 24. What is the purpose of the task:first = user INPUT(), last = user INPUT(), OUTPUT:first + last? A) To delete first and last names. B) To combine first and last names. C) To compare first and last names. D) To separate first and last names. Show Answer Correct Answer: B) To combine first and last names. 25. Which function adds a counter to a list when used in a for loop? A) Range(). B) Count(). C) Append(). D) Enumerate(). Show Answer Correct Answer: D) Enumerate(). ← 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