This quiz works best with JavaScript enabled. Home > Cbse > Class 11 > Science > Computer Science > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 24 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 24 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Which of the following types of computer languages that can be human readable and writable to communicate the computer? A) High-level languages. B) Low-level languages. C) Machine languages. D) Assembly languages. Show Answer Correct Answer: A) High-level languages. 2. What does the term 'machine code' refer to? A) Code that is written in a high-level programming language. B) Code that can be understood and executed by a computer. C) Code that is only readable by programmers. D) Code that is used for graphic design. Show Answer Correct Answer: B) Code that can be understood and executed by a computer. 3. Age=14print(Age)What is the output? A) 14. B) =14. C) Age. D) None of the above. Show Answer Correct Answer: A) 14. 4. Library NumPy fokus pada ..... A) Grafik visual. B) Pemrosesan teks yang sangat cepat dan efektif serta direkomendasi. C) Analisis regresi. D) Komputasi saintifik dengan array. Show Answer Correct Answer: D) Komputasi saintifik dengan array. 5. What is the effect of using 'del []' in PLS? A) It removes the item at from the list. B) It inserts an item just before an existing one at. C) It adds an item to the end of the list. D) It creates a new empty list. Show Answer Correct Answer: A) It removes the item at from the list. 6. What type of value does input() return in Python? A) Float. B) Bool. C) Str. D) Int. Show Answer Correct Answer: C) Str. 7. Read the Python program below:a = 13 a = a + 1 print(a)When this program is executed, what will be displayed on the screen? A) 14. B) 13 14. C) 13. D) There is an error in the program because there are no values for variable a that could be used in the equation in line 3. Show Answer Correct Answer: A) 14. 8. Which of the following is a Python data type? A) Int. B) Float. C) Str. D) All of the above. Show Answer Correct Answer: D) All of the above. 9. What is a function? A) A chunk of code that performs an action. B) A type of variable. C) An error in the program. D) None of the above. Show Answer Correct Answer: A) A chunk of code that performs an action. 10. What is data output? A) Data that put in to the computer. B) Data that is sent out to the user after processing. C) Data processing. D) None of the above. Show Answer Correct Answer: B) Data that is sent out to the user after processing. 11. You have t1 = (1, 2, 3) and t2 = ('a', 'b'). What is tuple(zip(t1, t2))? A) ((1, 'a'), (2, 'b')). B) ((1, 'a'), (2, 'b'), (3, 'c')). C) ((1, 'a'), (2, 'b'), (3, None)). D) ((1, 'a'), (2, 'b'), ('c', 3)). Show Answer Correct Answer: A) ((1, 'a'), (2, 'b')). 12. Which of the following is a Tkinter widget? A) Label. B) Button. C) Entry. D) All of the above. Show Answer Correct Answer: D) All of the above. 13. What, if anything, is wrong with the following?input=x("Type your password: ")print(x) A) The variable should be switched with the input command. B) Input commands don't need ( ). C) You can't print x. D) Nothing is wrong. Show Answer Correct Answer: A) The variable should be switched with the input command. 14. Which of the following is a valid variable assignment in Python? A) Name = 'Charlie'. B) User name = 'Daisy'. C) Name-123 = 'Bob'. D) 1name = 'Alice'. Show Answer Correct Answer: A) Name = 'Charlie'. 15. What is the purpose of the PyCharm IDE? A) General-purpose IDE. B) Specifically designed for Python development. C) Primarily for mobile app development. D) Focused on web development. Show Answer Correct Answer: B) Specifically designed for Python development. 16. What is the output of the following code:print(type(5))? A) . B) . C) . D) . Show Answer Correct Answer: A) . 17. Given tuple t = (1, 5, False, 3, 9), what does any(t) return and why? A) False, because numbers are ignored by any. B) True, because tuples always evaluate True. C) False, because False makes all elements falsy. D) True, at least one element is truthy. Show Answer Correct Answer: D) True, at least one element is truthy. 18. Which of the following statements will print the value of variable 'score'? A) Show(score). B) Display(score). C) Print(score). D) Echo(score). Show Answer Correct Answer: C) Print(score). 19. Module-2:Example Program:Magic 8 Ball with a ..... A) List. B) Dictionary. C) Tuple. D) String. Show Answer Correct Answer: A) List. 20. In the interactive mode, the value of a variable x can be found by: A) X. B) Print(x). C) Both a) and b). D) Value(x). Show Answer Correct Answer: C) Both a) and b). 21. What will be the output of the following code? "'pythonprint("The temperature is", 22, "degrees Celsius.") "' A) The temperature is 22 degrees Celsius. B) The temperature is22degrees Celsius. C) The temperature is degrees Celsius 22. D) The temperature is "22" degrees Celsius. Show Answer Correct Answer: A) The temperature is 22 degrees Celsius. 22. Which print statement correctly prints the value stored in score? A) Print(score = 10). B) Print(score). C) Print("score"). D) Print("10"). Show Answer Correct Answer: B) Print(score). 23. What is the result of the following expression:$3^2 + 4^2$ A) '5'. B) '25'. C) '12'. D) '7'. Show Answer Correct Answer: B) '25'. 24. X = 50def func():global xprint('x is', x)x = 2print('Changed global x to', x)func()print('Value of x is', x) A) X is 50 Changed global x to 2 Value of x is 50. B) X is 50 Changed global x to 2 Value of x is 2. C) X is 50 Changed global x to 50 Value of x is 50. D) None. Show Answer Correct Answer: B) X is 50 Changed global x to 2 Value of x is 2. 25. Find the output.print(80+20*4//2) A) Error. B) 200. C) 80. D) 120. Show Answer Correct Answer: D) 120. 26. You need to insert and remove items from a tuple, then restore it to an immutable form. What is the most appropriate workflow? A) Modify tuple directly using append and pop. B) Convert tuple to list, edit, convert back. C) Copy tuple, edit with slice assignment. D) Use sorted on tuple, then use del on it. Show Answer Correct Answer: B) Convert tuple to list, edit, convert back. 27. Which subprogram is used to make the turtle move backward? A) Turtle.forward(). B) Turtle.right(). C) Turtle.back(). D) Turtle.left(). Show Answer Correct Answer: C) Turtle.back(). 28. What will print('Hello' + 'World') show? A) Hello+World. B) Hello World. C) HelloWorld. D) Error. Show Answer Correct Answer: C) HelloWorld. 29. Which of the following is wrong in reference to naming of variable? A) Keywords are not allowed for variable names. B) Spaces are not allowed for variable names. C) Variable names can start from number. D) Special symbols are not allowed. Show Answer Correct Answer: C) Variable names can start from number. 30. In python programming, we DO NOT need to declare the type of data for variable A) TRUE. B) FALSE. C) All the above. D) None of the above. Show Answer Correct Answer: A) TRUE. 31. What is the purpose of the 'break' statement in the code snippet provided? A) To exit the current loop immediately when a condition is met. B) To skip the current iteration of the loop. C) To restart the loop from the beginning. D) To terminate the program execution. Show Answer Correct Answer: A) To exit the current loop immediately when a condition is met. 32. What is the difference between a statement and an expression? A) A statement is always true; an expression can be false. B) An expression performs an action; a statement evaluates to a value. C) A statement performs an action; an expression evaluates to a value. D) Both statements and expressions are the same in programming. Show Answer Correct Answer: C) A statement performs an action; an expression evaluates to a value. 33. Which of these is a computer coding program? A) Snake. B) Viper. C) Python. D) Cobra. Show Answer Correct Answer: C) Python. 34. An instruction is written to determine if the value in a is equal to the value in b.Choose the correct operator to complete the instruction:if a ..... b: A) < . B) =. C) ==. D) None of the above. Show Answer Correct Answer: C) ==. 35. How do you write a comment in Python? Why are comments important? A) Use '/* comment */' for multi-line comments. B) Comments are not necessary for code clarity. C) Use '//' for comments in Python. D) To write a comment in Python, use '#' for single-line comments or triple quotes for multi-line comments. Comments are important because they help explain the code, making it easier to understand and maintain. Show Answer Correct Answer: D) To write a comment in Python, use '#' for single-line comments or triple quotes for multi-line comments. Comments are important because they help explain the code, making it easier to understand and maintain. 36. Which of the following is a mapping type in Python? A) Dict. B) Tuple. C) Range. D) List. Show Answer Correct Answer: A) Dict. 37. Name the famous Module used for Web Scraping A) Random. B) Beautiful Soup. C) Pyautogui. D) Numpy. Show Answer Correct Answer: B) Beautiful Soup. 38. Write the output of the following:m, n, p = 1, 2, 3; print(m, n, p) A) Error. B) 1, 2, 3. C) 1 2 3. D) Print 1, 2 and 3 vertically. Show Answer Correct Answer: C) 1 2 3. 39. What does the for loop do? A) Asks for user input. B) Checks conditions. C) Repeats code a set number of times. D) Stores information. Show Answer Correct Answer: C) Repeats code a set number of times. 40. What is 3 + 2 in Python? A) 5. B) 6. C) 7. D) 8. Show Answer Correct Answer: A) 5. 41. How do you draw a half-circle using the turtle library's 'circle' subprogram? A) By not providing an extent. B) By setting the extent to 180. C) By setting the radius to 0. D) By setting the extent to 360. Show Answer Correct Answer: B) By setting the extent to 180. 42. What is missing from this line of code? pencolor(red) A) Pencolor(red). B) Pencolor("red"). C) Pencolor('red'). D) Pencolor(red, 0). Show Answer Correct Answer: C) Pencolor('red'). 43. Which of these is an integer? A) 23.5. B) Lake Butler Middle School. C) True/False. D) 5. Show Answer Correct Answer: D) 5. 44. What is a string in Python? A) A string in Python is a type of number. B) A string in Python is a collection of functions. C) A string in Python is a variable that holds a list. D) A string in Python is a sequence of characters enclosed in quotes. Show Answer Correct Answer: D) A string in Python is a sequence of characters enclosed in quotes. 45. What is the correct way to create an empty list in Python? A) { }. B) [ ]. C) List. D) ( ). Show Answer Correct Answer: B) [ ]. 46. Who created python language? A) Guido van rossum. B) Goido wan rossum. C) Gallio van rose. D) Guild van rossum. Show Answer Correct Answer: A) Guido van rossum. 47. Which built-in function returns the maximum value in an iterable? A) High(). B) Maximum(). C) Max(). D) Biggest(). Show Answer Correct Answer: C) Max(). 48. How do you import the Pandas library with the alias pd? A) Import pandas as pd. B) Import Pandas as pd. C) Include pandas. D) Import panda. Show Answer Correct Answer: A) Import pandas as pd. 49. What will be the output of the following code?x = 1while x < 5:print(x)x = x + 1 A) 1 2 3 4 5. B) 0 1 2 3 4. C) 2 3 4 5. D) 1 2 3 4. Show Answer Correct Answer: D) 1 2 3 4. 50. What is the default Python IDE that comes with Python installation? A) PyCharm. B) Jupyter Notebook. C) IDLE. D) Eclipse. Show Answer Correct Answer: C) IDLE. 51. Struktur data DataFrame memiliki tiga identitas utama, yaitu ..... A) Kolom, baris, fungsi. B) Data, list, tuple. C) Label, nilai, tipe. D) Indeks, kolom, value. Show Answer Correct Answer: D) Indeks, kolom, value. 52. What does the 'for' loop in iteration constructs do when used with a range function? A) Executes commands for each element of a data structure in two dimensions. B) Executes commands for each element of a data structure in one dimension. C) Executes commands a fixed number of times, based on the numbers generated by the range function. D) Executes commands while a condition is true. Show Answer Correct Answer: C) Executes commands a fixed number of times, based on the numbers generated by the range function. 53. Computer program that directly executes instructions written in a programming or scripting language. (i.e. Python IDLE) A) Interactive mode. B) Script mode. C) Sandbox. D) Interpreter. Show Answer Correct Answer: D) Interpreter. 54. What is the variable in the line of code below? firstname = input( "What is your name?" ) A) Variable. B) Name. C) Input. D) Firstname. Show Answer Correct Answer: D) Firstname. 55. High-level languages need to be compiled into machine code before they can be used by a computer. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 56. What is an if statement used for? A) To declare variables in programming. B) To create loops in programming. C) To control the flow of execution in programming. D) To define functions in programming. Show Answer Correct Answer: C) To control the flow of execution in programming. 57. What will happen if you try to use a reserved keyword as a variable name? A) The code will work fine. B) It will convert the keyword to a string. C) It will be ignored. D) It will raise a syntax error. Show Answer Correct Answer: D) It will raise a syntax error. 58. Code for257Hello, World! A) X = 257y = "Hello, World!"print(y)print(x). B) X = 257y = "Hello, World!"print(x)print(y). C) X = 257y = Hello, World!print xprint y. D) None of the above. Show Answer Correct Answer: B) X = 257y = "Hello, World!"print(x)print(y). 59. What is the output of the following code? "'pythonprint(type(42)) "' A) . B) . C) . D) . Show Answer Correct Answer: A) . 60. A computer program is best described as: A) A set of instructions that tells a computer what to do. B) A type of computer memory. C) The physical parts of a computer. D) The electricity that powers a computer. Show Answer Correct Answer: A) A set of instructions that tells a computer what to do. ← 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 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 8 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books