This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 27 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 27 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What is string? A) A collection of characters encapsulated in a single/double quote. B) A collection of characters encapsulated in a parenthesis. C) A collection of characters encapsulated. D) A string. Show Answer Correct Answer: A) A collection of characters encapsulated in a single/double quote. 2. Which command is used to read every line from a file one at a time in Python? A) .readline(). B) .close(). C) For in:. D) .writelines(). Show Answer Correct Answer: C) For in:. 3. Which of the following is a string data type in Python? A) '"London"'. B) '25'. C) 'True'. D) '3.5'. Show Answer Correct Answer: A) '"London"'. 4. If first ..... name = "Kevin" and last ..... name = "Drumm", which line joins them with a space? A) Print(first name + last name). B) Print(first name + '' '' + last name). C) Print(first name, last name). D) Print("first name" + "last name"). Show Answer Correct Answer: B) Print(first name + '' '' + last name). 5. What is the output of the following code?print("The temperature is", 25, "degrees Celsius.") A) The temperature is 25 degrees Celsius. B) The temperature is 25degrees Celsius. C) The temperature is25 degrees Celsius. D) The temperature is 25 degrees Celsius. Show Answer Correct Answer: A) The temperature is 25 degrees Celsius. 6. Matplotlib digunakan untuk ..... A) Membuat visualisasi data. B) Menyimpan data. C) Melatih model prediksi. D) Membersihkan data. Show Answer Correct Answer: A) Membuat visualisasi data. 7. Escape sequence is represented by a ..... followed by one or more characters A) Front slash. B) Double Quote. C) Single Quote. D) Back Slash. Show Answer Correct Answer: D) Back Slash. 8. Python is ..... level programming language and is ..... A) High, compiled. B) High, interpreted. C) Low, compiled. D) Low, interpreted. Show Answer Correct Answer: B) High, interpreted. 9. What is the correct syntax to define a multi-line string in Python? A) "This is a multiline string". B) """This is a multiline string""". C) 'This is a multiline string'. D) [[This is a multiline string]]. Show Answer Correct Answer: B) """This is a multiline string""". 10. What does IDE stand for? A) Integrated Development Environment. B) Interactive Development Language. C) Integrated Data Language. D) Interactive Development Environment. Show Answer Correct Answer: A) Integrated Development Environment. 11. Which of these is a correct variable name? A) 2name. B) Name1. C) Name!. D) My-name. Show Answer Correct Answer: B) Name1. 12. If you want to store the value 3.14 in a variable called 'pi', which data type will Python use? A) Integer. B) String. C) Float. D) Boolean. Show Answer Correct Answer: C) Float. 13. Print("Enter a number")number = int(input())if number = 0:print(number, "is zero")else:print(number, "is non-zero")When this program is executed, what will be displayed on the screen, if the user enters 0 at the prompt? A) 0 is zero0 is non-zero. B) 0 is zero. C) 0 is non-zero. D) There is a syntax error in the condition in line 3. Show Answer Correct Answer: D) There is a syntax error in the condition in line 3. 14. Id() function is used to get A) The datatype of a varaible. B) Value to which a variable is bound. C) The variable's address in the memory. D) The information about the variable's value. Show Answer Correct Answer: C) The variable's address in the memory. 15. Which statement is TRUE about variables? A) A variable can never change. B) A variable stores data and its value can change while a program runs. C) A variable must always store a sentence. D) A variable is the same as print(). Show Answer Correct Answer: B) A variable stores data and its value can change while a program runs. 16. Let a = ("apple", "banana") and b = ("cherry", ). Which result comes from a + b? A) ("apple", ) without change. B) ("apple", "cherry", "banana"). C) ("apple", "banana", "cherry"). D) ("banana", "cherry") only. Show Answer Correct Answer: C) ("apple", "banana", "cherry"). 17. What does the print() function do in Python? A) The print() function saves data to a file. B) The print() function displays output to the console. C) The print() function reads input from the user. D) The print() function performs mathematical calculations. Show Answer Correct Answer: B) The print() function displays output to the console. 18. Which library must be imported to use the sqrt() function? A) Numpy. B) Statistics. C) Random. D) Math. Show Answer Correct Answer: D) Math. 19. What is the output of the expression 8 // 3? A) 3.0. B) 3. C) 2.67. D) 2. Show Answer Correct Answer: D) 2. 20. How do you convert a string to an integer in Python? A) String.to int(). B) Str('string'). C) Convert('string'). D) Int('string'). Show Answer Correct Answer: D) Int('string'). 21. What will be the output of the following code?if 5 > 3:print("Yes") A) No. B) Yes. C) True. D) False. Show Answer Correct Answer: B) Yes. 22. What command is used to print text to the screen? A) Show(). B) Output(). C) Print(). D) Input(). Show Answer Correct Answer: C) Print(). 23. What is the output of the expression 10 / 2? A) 20. B) 10. C) 2. D) 5. Show Answer Correct Answer: D) 5. 24. How is a block of code defined in Python? A) With indentation. B) With paranthesis. C) With curly braces. D) None of the above. Show Answer Correct Answer: A) With indentation. 25. What is the index of the first element in a Python list? A) 1. B) 0. C) -1. D) None. Show Answer Correct Answer: B) 0. ← 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