This quiz works best with JavaScript enabled. Home > Cbse > Class 11 > Science > Computer Science > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 4 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 4 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What is the difference between '==' and '!=' in Python? A) '==' checks for inequality, while '!=' checks for equality. B) '==' is used for assignment, while '!=' is used for comparison. C) '==' checks for equality, while '!=' checks for inequality. D) Both '==' and '!=' are used to check for equality. Show Answer Correct Answer: C) '==' checks for equality, while '!=' checks for inequality. 2. What does the logical/Boolean operator 'and' do? A) Returns true if either side of the test is true. B) Inverts the result of the test. C) Returns true if both sides of the test are true. D) Compares two values to see if they are less than or equal. Show Answer Correct Answer: C) Returns true if both sides of the test are true. 3. What is the minimum passing mark for the Continuous Internal Evaluation (CIE) as a percentage of the maximum marks? A) 30%. B) 50%. C) 40%. D) 35%. Show Answer Correct Answer: C) 40%. 4. Is a, b = 6 statement will return an error (T/F) A) Depends on the context. B) False. C) True. D) Not applicable. Show Answer Correct Answer: C) True. 5. What is a tuple in Python? A) A tuple is an immutable sequence type in Python, defined by items in parentheses. B) A tuple can be modified after creation. C) A tuple is a mutable sequence type in Python. D) A tuple is defined by items in square brackets. Show Answer Correct Answer: A) A tuple is an immutable sequence type in Python, defined by items in parentheses. 6. What will be the output of the following code? "'pythonprint(7 + 3 * 2) "' A) 17. B) 20. C) 26. D) 13. Show Answer Correct Answer: D) 13. 7. What would print (10 + 16) produce? A) 10. B) 16. C) 24. D) 26. Show Answer Correct Answer: D) 26. 8. What is the output of the following code:num = (11, 12, 13, 14)num[-4:-3] A) (11, ). B) (11, 12). C) (12, 13). D) None of the above. Show Answer Correct Answer: A) (11, ). 9. If a function contains more than one argument, how are the arguments separated? A) With a semi-colon. B) With a comma. C) With a question mark. D) With a full stop. Show Answer Correct Answer: B) With a comma. 10. What is the purpose of an assignment in programming constructs? A) To execute a command repeatedly. B) To set or change the value of a variable. C) To determine the scope and extent of variables. D) To execute a command if a condition is true. Show Answer Correct Answer: B) To set or change the value of a variable. 11. What is the output of print(type(3.14))? A) . B) . C) . D) . Show Answer Correct Answer: A) . 12. How do you print the string 'Welcome to Python!' using double quotes? A) Print('Welcome to Python!'). B) Print("Welcome to Python!"). C) Print("""Welcome to Python!"""). D) All of the above. Show Answer Correct Answer: B) Print("Welcome to Python!"). 13. The only language a computer and other electronic devices understand is: A) English. B) Machine language. C) High-level language. D) Python. Show Answer Correct Answer: B) Machine language. 14. What is the correct way to take user input in Python? A) Read(). B) Get(). C) Scan(). D) Input(). Show Answer Correct Answer: D) Input(). 15. Python adalah bahasa pemrograman yang ..... A) Bersifat compiled, low-level, dan specific-purpose. B) Semua jawaban benar. C) Bersifat object-oriented, dynamic, dan functional. D) Bersifat interpreted, high-level, dan general-purpose. Show Answer Correct Answer: D) Bersifat interpreted, high-level, dan general-purpose. 16. The default return value of any function in Python is ..... A) Null. B) 0. C) None. D) Garbage value. Show Answer Correct Answer: C) None. 17. Which of the following statements will not work properly within a while loop? A) Break. B) Continue. C) Pass. D) Return. Show Answer Correct Answer: D) Return. 18. What is Python named after, and who created it? A) A British comedy group; Guido van Rossum. B) A type of car; Larry Page. C) A species of snake; Bill Gates. D) A Greek god; Guido van Rossum. Show Answer Correct Answer: A) A British comedy group; Guido van Rossum. 19. Which of the following is a valid way to define a variable in Python? A) Variable-1 = 5. B) Variable.1 = 5. C) 1variable = 5. D) Variable 1 = 5. Show Answer Correct Answer: D) Variable 1 = 5. 20. Which mode of using the Python interpreter allows for immediate code execution? A) Script mode. B) Compile mode. C) Debug mode. D) Interactive mode. Show Answer Correct Answer: D) Interactive mode. 21. What command do you use to display text in Python? A) Text(). B) Print(). C) Show(). D) Display(). Show Answer Correct Answer: B) Print(). 22. What is the output of the following code?print(type(10.5)) A) . B) . C) . D) . Show Answer Correct Answer: C) . 23. What will be the result of the following code?def add ..... numbers (a, b):return a + bprint(add ..... numbers (5) ) A) None. B) 5. C) 10. D) Error. Show Answer Correct Answer: D) Error. 24. What is the output of the following code? print(10 / 2) A) Error. B) 2. C) 10. D) 5. Show Answer Correct Answer: D) 5. 25. Connecting 2 strings in Python with the + Operator is called A) Condogenation. B) Concatenation. C) Contamination. D) Conmousenation. Show Answer Correct Answer: B) Concatenation. 26. What does SQL stand for? A) Structured Query Language. B) Simple Query Language. C) Standard Query Language. D) Sequential Query Language. Show Answer Correct Answer: A) Structured Query Language. 27. Which code snippet correctly creates a tuple containing three integers? A) Nums = (1, 2, 3). B) Nums = [1, 2, 3]. C) Nums = {1, 2, 3}. D) Nums = 1, 2, 3. Show Answer Correct Answer: A) Nums = (1, 2, 3). 28. Which symbol is used to comment in Python? A) #. B) . C) //. D) *. Show Answer Correct Answer: A) #. 29. What is the purpose of the 'else' clause in a try-except block? A) To handle the exception. B) To execute if an exception occurs. C) To ignore the exception. D) To define the exception. Show Answer Correct Answer: B) To execute if an exception occurs. 30. Which keyword is used to start an if statement in Python? A) For. B) When. C) Else. D) If. Show Answer Correct Answer: D) If. 31. Which of the following applications is NOT commonly developed using Python? A) Desktop GUI Applications. B) Web Development. C) Embedded Systems and IoT. D) Operating System Kernels. Show Answer Correct Answer: D) Operating System Kernels. 32. What is the purpose of comments in Python code? A) To make the code more readable. B) To execute code. C) To define variables. D) None of the above. Show Answer Correct Answer: A) To make the code more readable. 33. Square brackets in an assignment statement will create which type of data structure?( s=[] ) A) Set. B) Dictionary. C) List. D) Queue. Show Answer Correct Answer: C) List. 34. What will be the output of the following code? "'pythonfor i in range(3):print(i) "' A) '1 2 3 4'. B) '0 1 2 3'. C) '1 2 3'. D) '0 1 2'. Show Answer Correct Answer: D) '0 1 2'. 35. Which construct is used to handle exceptions in Python? A) Do except. B) Try except. C) Try catch. D) Catch throw. Show Answer Correct Answer: B) Try except. 36. What is a correct syntax to return the first character in a string? A) X=sub("Hello", 0, 1). B) X="Hello"[0]. C) X=substring("Hello", 0, 1). D) X="Hello" .sub(0, 1). Show Answer Correct Answer: B) X="Hello"[0]. 37. What is the primary feature of a Python set? A) It preserves the order of elements. B) It allows duplicate elements. C) It stores elements in key-value pairs. D) It is an unordered collection of unique items. Show Answer Correct Answer: D) It is an unordered collection of unique items. 38. How do you update data in SQL? A) SET. B) CHANGE. C) MODIFY. D) UPDATE. Show Answer Correct Answer: D) UPDATE. 39. Which of the following is a control structure in Python? A) Variable. B) Loop. C) String. D) Function. Show Answer Correct Answer: B) Loop. 40. Which of the below is the code for creating a variable? A) Name = "John". B) First name = "Molly". C) Number == 3. D) 3 = number. Show Answer Correct Answer: A) Name = "John". 41. The result of this program:Friday = Falseif Friday:print("Jeans day!")else:print("Uniform day") A) Jeans day. B) Today is Friday. C) Uniform day. D) Not Friday. Show Answer Correct Answer: C) Uniform day. 42. Why is indentation important in 'if' statements? A) It tells Python which code belongs inside the 'if'. B) It makes the code run faster. C) It changes numbers into strings. D) It automatically fixes errors. Show Answer Correct Answer: A) It tells Python which code belongs inside the 'if'. 43. Which keyword is used to import specific functions from a module? A) Import. B) From. C) Def. D) Include. Show Answer Correct Answer: B) From. 44. What is the next topic to be covered in the following class? A) Advanced data structures. B) Creating reusable code blocks with functions. C) Machine learning basics. D) Web development with Python. Show Answer Correct Answer: B) Creating reusable code blocks with functions. 45. What type of data does the 'str' data type represent? A) Numeric values. B) Textual data. C) None of the above. D) Boolean values. Show Answer Correct Answer: B) Textual data. 46. The default IDE that comes with Python is called: A) Visual Studio Code. B) IDLE. C) PyCharm. D) Spyder. Show Answer Correct Answer: B) IDLE. 47. What is the function of a variable in Python? A) A variable is a combination of letters and numbers. B) A variable is a location in memory to temporarily store text or numbers. C) A variable is a special keyword that does a specific job. D) A variable is a sequence of instructions. Show Answer Correct Answer: B) A variable is a location in memory to temporarily store text or numbers. 48. What is a loop used for? A) To repeat actions. B) To make decisions. C) To print text. D) To store data. Show Answer Correct Answer: A) To repeat actions. 49. Arrange this in order of Precedence.1. Exponentiation2. Parentheses3. Multiplication and Division4. Addition and Subtraction A) 1, 2, 3, 4. B) 2, 1, 3, 4. C) 2, 3, 1, 4. D) 1, 2, 4, 3. Show Answer Correct Answer: B) 2, 1, 3, 4. 50. Which of the following is not correct for naming an identifier in Python? A) We cannot use special symbols like !, @, #, $ , %, etc., in identifiers. B) Identifier should not be a keyword. C) Spaces are allowed in identifiers. D) Identifier can be of any length. Show Answer Correct Answer: C) Spaces are allowed in identifiers. 51. The course demonstrates the use of built-in functions to navigate the file system. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 52. Which method is used to find the memory location of a variable? A) Id(). B) None of the above. C) Add(). D) Type(). Show Answer Correct Answer: A) Id(). 53. What is the answer to? print(10 % 4) A) 1. B) 4. C) 3. D) 2. Show Answer Correct Answer: D) 2. 54. In the following code, "city" is an example of a what?city= "Exeter" A) List. B) Loop. C) Variable. D) Array. Show Answer Correct Answer: C) Variable. 55. How does Python support community engagement? A) Python does not have any forums or conferences. B) Python engages its community through open-source contributions, forums, conferences, and educational resources. C) Python only supports community engagement through paid memberships. D) Python's community engagement is limited to social media posts. Show Answer Correct Answer: B) Python engages its community through open-source contributions, forums, conferences, and educational resources. 56. Which control flow statement is used for decision making? A) For. B) While. C) Break. D) If. Show Answer Correct Answer: D) If. 57. What will be the output of the following code?x = 10x = "Hello" print(x) A) 10. B) 10 Hello. C) Hello. D) Error. Show Answer Correct Answer: C) Hello. 58. Teaching-Learning Process:Which online tool is suggested for visualizing Python code? A) Coursera.org. B) Codeacademy.com. C) Edx.org. D) Pythontutor.com. Show Answer Correct Answer: D) Pythontutor.com. 59. Which method converts a string to lowercase in Python? A) Str.toLower(). B) Str.lowercase(). C) Str.tolower(). D) Str.lower(). Show Answer Correct Answer: D) Str.lower(). 60. What is the correct file extension for Python files? A) .pt. B) .pyt. C) .txt. D) .py. Show Answer Correct Answer: D) .py. ← PreviousNext →Related QuizzesScience QuizzesClass 11 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 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 9 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books