This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 47 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 47 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly A) True. B) False. C) It means your code is running slowly. D) It indicates a logical error in the code. Show Answer Correct Answer: A) True. 2. Which of the following is the correct way to define a function in Python? A) Function myFunc():. B) Def myFunc():. C) Define myFunc():. D) Func myFunc():. Show Answer Correct Answer: B) Def myFunc():. 3. A price such as 3.65 pesos should be saved as what kind of variable? A) String. B) Integer. C) Boolean. D) Float. Show Answer Correct Answer: D) Float. 4. What is the result of 3**2 A) 6. B) 9. C) 27. D) 18. Show Answer Correct Answer: B) 9. 5. What does casting do? A) Changes a data type. B) Magic. C) Joins strings together. D) Raises a number to a power. Show Answer Correct Answer: A) Changes a data type. 6. Describe the structure of an if-elif-else statement. A) If (condition) \{ // code \} else \{ // code \} elif (condition) \{ // code \}. B) If (condition) \{ // code \} else if (condition) \{ // code \}. C) If (condition) \{ // code \} elseif (condition) \{ // code \} else \{ // code \}. D) The structure is:if (condition) \{ // code \} elif (condition) \{ // code \} else \{ // code \}. Show Answer Correct Answer: D) The structure is:if (condition) \{ // code \} elif (condition) \{ // code \} else \{ // code \}. 7. What is the output of the following code? "'pythoncount = 0while count < 3:print(count) count += 1 "' A) 0 1 2. B) 1 2 3. C) 0 1 2 3. D) 1 2. Show Answer Correct Answer: A) 0 1 2. 8. Karel can't A) Move. B) Spin. C) Turn right. D) Turn left. Show Answer Correct Answer: C) Turn right. 9. Fill in the blank:The Integer, Floating-Point, and String Data Types are introduced in ..... A) Module-1. B) Module-2. C) Module-3. D) Module-4. Show Answer Correct Answer: A) Module-1. 10. What is the meaning of the arithmetic operator '%' in programming? A) Addition. B) Subtraction. C) Modulus. D) Multiplication. Show Answer Correct Answer: C) Modulus. 11. An element of a programme which stores a value that can change as the programme is run A) Algorithm. B) Function. C) Variable. D) Concatenate. Show Answer Correct Answer: C) Variable. 12. The smallest individual unit in a program is called as A) Token. B) Lexical Unit. C) Both a and b. D) None of the above. Show Answer Correct Answer: C) Both a and b. 13. Python code runs ..... A) Bottom to top. B) Randomly. C) Line by line. D) None of the above. Show Answer Correct Answer: C) Line by line. 14. What is the function of the 'else' statement in selection constructs? A) It is executed if the 'if' condition is false. B) It is executed before the 'if' condition is checked. C) It is mandatory to use with 'elif'. D) It is used to repeat a command. Show Answer Correct Answer: A) It is executed if the 'if' condition is false. 15. What is the effect of the following import statement?from math import * A) Imports only specific functions from math module. B) Imports all functions from math module. C) Imports math module but does not include its functions. D) Imports the math module as an alias. Show Answer Correct Answer: B) Imports all functions from math module. 16. Which of the following is NOT a legal variable name A) Grade5. B) #info. C) Time minute. D) YourName. Show Answer Correct Answer: B) #info. 17. How do you ask an input from a user? A) Name = int("what is your name"). B) Name = input(what is your name?). C) Input = name("what is your name?"). D) Name = input("what is your name?"). Show Answer Correct Answer: D) Name = input("what is your name?"). 18. What will be the output of the following code? "'pythonx = input("Enter a number: ")print(type(x)) "' A) . B) . C) . D) NAN. Show Answer Correct Answer: C) . 19. What is the purpose of f-strings in Python? A) To execute loops. B) To define variables. C) To create functions. D) To format strings. Show Answer Correct Answer: D) To format strings. 20. Comments in Python program are ..... by interpreter A) Given. B) Not executed. C) Executed. D) Shared. Show Answer Correct Answer: B) Not executed. 21. What is the output of the following Python code? print("Hello, world!") A) Hello, world!. B) A syntax error. C) No output. D) None of the above. Show Answer Correct Answer: A) Hello, world!. 22. What will be the output of print(bool([]))? A) True. B) False. C) None. D) Error. Show Answer Correct Answer: B) False. 23. What will be the output?name = "Dave"print (name) A) Dave. B) 'Dave'. C) Name. D) (name). Show Answer Correct Answer: A) Dave. 24. What does "assignment" mean in Python? A) Joining two strings together with +. B) Printing a value to the screen. C) Storing a value in a variable using =. D) Checking if two things are equal using ==. Show Answer Correct Answer: C) Storing a value in a variable using =. 25. Which of the following is a correct 'for' loop in Python? A) 'for i in range(5):'. B) 'for (i = 0; i < 5; i++)'. C) 'for i to 5'. D) 'for i from 0 to 5'. Show Answer Correct Answer: A) 'for i in range(5):'. ← 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