This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 23 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 23 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What is the result of this expression:3 + 2 * 4? A) 20. B) 14. C) 11. D) 16. Show Answer Correct Answer: C) 11. 2. What does the ' = open(, "a")' command do in Python? A) Opens a file for reading. B) Opens a file for writing. C) Opens a file for appending. D) Closes a file. Show Answer Correct Answer: C) Opens a file for appending. 3. Python identifies blocks of code by A) BEGIN and END keywords. B) \{ and \}. C) Aligning up the starts of lines (indentation). D) Guessing. Show Answer Correct Answer: C) Aligning up the starts of lines (indentation). 4. How does the Python community contribute to its popularity? A) By providing online resources, forums, and tutorials. B) By keeping the language closed-source. C) By limiting the development of new libraries. D) By discouraging collaboration. Show Answer Correct Answer: A) By providing online resources, forums, and tutorials. 5. The list needs one more name added to the end- "Felipe" . Which piece of code below would do this?nameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"] A) NameList.append(Felipe). B) Append(nameList, "Felipe"). C) NameList.append["Felipe", 7]. D) NameList.append("Felipe"). Show Answer Correct Answer: D) NameList.append("Felipe"). 6. Which symbol means "equal to" in an 'if' condition? A) ==. B) <=. C) !=. D) =. Show Answer Correct Answer: A) ==. 7. What is the result of the following expression in Python:'3 + 4.5'? A) 7. B) 7.5. C) 7.0. D) 8. Show Answer Correct Answer: B) 7.5. 8. What is the output of the following code? "'pythona = 10b = 5print(a // b) "' A) 2.0. B) 2. C) 0. D) 5. Show Answer Correct Answer: B) 2. 9. How do you delete data in SQL? A) DELETE. B) REMOVE. C) DROP. D) ERASE. Show Answer Correct Answer: A) DELETE. 10. Which is the correct syntax for a while loop that increments x until it reaches 5? A) While (x < 5) \{ x += 1 \}. B) While x < 5:x += 1. C) While x < 5 do:x += 1. D) While (x < 5):\{ x += 1 \}. Show Answer Correct Answer: B) While x < 5:x += 1. 11. Which of the following is used to create a tuple in Python? A) []. B) \{\}. C) (). D) <>. Show Answer Correct Answer: C) (). 12. What is the purpose of algorithms? A) To solve a problem. B) To translate programming languages. C) To execute instructions. D) To display messages. Show Answer Correct Answer: A) To solve a problem. 13. X = 50def func(x):print('x is', x)x = 2print('Changed local x to', x)func(x)print('x is now', x) A) X is 50 Changed local x to 2 x is now 50. B) X is 50 Changed local x to 2 x is now 2. C) X is 50 Changed local x to 2 x is now 100. D) None. Show Answer Correct Answer: A) X is 50 Changed local x to 2 x is now 50. 14. What happens if you leave out one of the double quotes in a string? A) The program displays a warning. B) The program ignores the missing quote. C) The program runs normally. D) The program gives an error message. Show Answer Correct Answer: D) The program gives an error message. 15. How do you create a negative of a picture in Python? A) By reversing the color values of each pixel. B) By applying a filter to the picture. C) By changing the brightness of the picture. D) By using the getPixels function. Show Answer Correct Answer: A) By reversing the color values of each pixel. 16. What is the output of print(type("5"))? A) Int. B) Float. C) Str. D) None. Show Answer Correct Answer: C) Str. 17. What does BIDMAS stand for? A) Brackets, Indices, Division, Multiplication, Addition, Subtraction. B) Brackets, Indices, Division, Multiplication, Addition, Subtraction. C) Brackets, Indices, Division, Multiplication, Addition, Subtraction. D) Brackets, Indices, Division, Multiplication, Addition, Subtraction. Show Answer Correct Answer: A) Brackets, Indices, Division, Multiplication, Addition, Subtraction. 18. Give an example of python output? A) Print(" "). B) Print**. C) Print(". D) Print. Show Answer Correct Answer: A) Print(" "). 19. What will happen if you do not indent code properly in Python? A) It will cause a syntax error. B) It will run but give incorrect results. C) The code will run successfully. D) It will display a warning. Show Answer Correct Answer: A) It will cause a syntax error. 20. In a for loop using enumerate on a tuple, which unpacking is correct to access index and value? A) For i in t:enumerate(i). B) For v, i in enumerate(t):. C) For index in enumerate(t):. D) For i, v in enumerate(t):. Show Answer Correct Answer: D) For i, v in enumerate(t):. 21. A ..... is a single Python file which contains Python objects such as variables, functions and classes and may also contain executable code, not just definitions. A) Directory. B) Module. C) Collection. D) None of the mentioned. Show Answer Correct Answer: B) Module. 22. Which of the following is the correct format for a for-loop in Python? A) For x in 5:. B) For x in range(5):. C) For x <= 5:. D) For x to 5:. Show Answer Correct Answer: B) For x in range(5):. 23. What does 'int' mean in Python? A) Interesting. B) Integer. C) Internal. D) Into. Show Answer Correct Answer: B) Integer. 24. To display output on the screen python uses A) Print (). B) PRINT (" "). C) Print ("hello there"). D) Print(). Show Answer Correct Answer: D) Print(). 25. What will be the output of the following code? print(5 == 5) A) None. B) False. C) True. D) Error. Show Answer Correct Answer: C) True. ← 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