This quiz works best with JavaScript enabled. Home > Cbse > Class 11 > Science > Computer Science > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 28 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 28 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What does the keyboard shortcut CTRL+Z do? A) Copy. B) Cut. C) Undo. D) Save. Show Answer Correct Answer: C) Undo. 2. What does syntax refer to in programming languages? A) A. B) B. C) All the above. D) None of the above. Show Answer Correct Answer: A) A. 3. What is the importance of syntax in Python programming? A) It is only for advanced programmers. B) It helps in debugging errors. C) It makes the code run faster. D) It has no importance. Show Answer Correct Answer: B) It helps in debugging errors. 4. What is the output of the following Python code?a = 3b = a + 4print(a, b) A) 3 4. B) 3 7. C) 7 3. D) 4 7. Show Answer Correct Answer: B) 3 7. 5. What is the purpose of the turtle.Screen() subprogram? A) It closes the turtle window. B) It sets the size of the turtle window. C) It returns a variable to address the turtle window. D) It changes the turtle mode to "standard". Show Answer Correct Answer: C) It returns a variable to address the turtle window. 6. Evaluate the following expression:"dog" < "Dog" A) True. B) False. C) They are the same word. D) None of the above. Show Answer Correct Answer: B) False. 7. What are variables used for? A) Variables are used to print data values. B) Variables are used to output data values. C) Variables are used to store data values. D) Variables are used to input data values. Show Answer Correct Answer: C) Variables are used to store data values. 8. Python teaches computers to think for themselves. What is this called? A) Artificial Intelligence (AI). B) Python Intelligence (PI). C) Computer Intelligence (CI). D) Anti-Intelligence (AI). Show Answer Correct Answer: A) Artificial Intelligence (AI). 9. What will the following code output? 'print("Hello, World!")' A) Hello, World. B) Hello, World!. C) "Hello, World!". D) Error. Show Answer Correct Answer: B) Hello, World!. 10. Which of these platforms do we use for Python coding exercises? A) PyCharm. B) Microsoft Word. C) Roblox Studio. D) Canva. Show Answer Correct Answer: A) PyCharm. 11. What type of error is a syntax error in Python? A) Runtime error. B) Typographical error. C) Logical error. D) Compilation error. Show Answer Correct Answer: A) Runtime error. 12. Is Python case sensitive language? A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 13. The Python programming language is named after A) A Mountain. B) It's a made-up word. C) The british comedy group Monty Python. D) A snake. Show Answer Correct Answer: C) The british comedy group Monty Python. 14. What does print() do in Python? A) Joins strings together. B) Stores a value inside a variable. C) Displays output on the screen. D) Changes the type of a variable. Show Answer Correct Answer: C) Displays output on the screen. 15. What is the purpose of the if statement in Python? A) To define a function in Python. B) To create a loop that iterates over a list. C) To execute code conditionally based on a boolean expression. D) To import modules and libraries in Python. Show Answer Correct Answer: C) To execute code conditionally based on a boolean expression. 16. Which of the following is the correct way to write a comment in Python? A) This is a comment. B) # This is a comment. C) // This is a comment. D) /* This is a comment */. Show Answer Correct Answer: B) # This is a comment. 17. What does the APPEND procedure do in the following code:teams = [ "Man Utd" , "Man City" , "Arsenal"] teams.append( "Liverpool" ) A) Adds Liverpool the list. B) Adds Chelsea to the list. C) Removes Arsenal from the list. D) Deletes Liverpool from the list. Show Answer Correct Answer: A) Adds Liverpool the list. 18. What will the following code output if the user enters "Harry" ? "'pythonname = input("What is your name? ")print("Hello, '' + name) "' A) What is your name? Harry. B) Hello, Harry. C) Harry. D) Hello,. Show Answer Correct Answer: B) Hello, Harry. 19. How do you activate a virtual environment in Python (Windows)? A) Activate. B) Env. C) Source env/bin/activate. D) . activate. Show Answer Correct Answer: A) Activate. 20. In a flowchart, which shape is used to represent a decision? A) Rectangle. B) Parallelogram. C) Oval. D) Diamond. Show Answer Correct Answer: D) Diamond. 21. In Python, what is the term used to describe the names given to variables, functions, classes, and modules? A) Literals. B) Keywords. C) Identifiers. D) Expressions. Show Answer Correct Answer: C) Identifiers. 22. Why is Python often used in scientific computing? A) Because Python is not suitable for other types of computing. B) Because Python is a low-level language. C) Because Python is the only language that can be used for scientific computing. D) Because Python has a large number of libraries that are useful in scientific computing. Show Answer Correct Answer: D) Because Python has a large number of libraries that are useful in scientific computing. 23. Which of the following is not the category of token? A) CONSTANTS. B) KEYWORDS. C) LITERALS. D) OPERATORS. Show Answer Correct Answer: A) CONSTANTS. 24. When does a SYNTAX error come? A) When you click on something. B) A SYNTAX error comes when your code is wrong. C) When you don't form a sentence. D) All of the above. Show Answer Correct Answer: B) A SYNTAX error comes when your code is wrong. 25. Alasan utama menggunakan Jupyter Notebook adalah karena ..... A) Mudah digunakan dan bisa dikonversi ke berbagai format. B) Tidak mendukung bahasa Python karena tidan singkron dengan data. C) Tidak bisa dijalankan offline. D) Tidak mendukung format lain. Show Answer Correct Answer: A) Mudah digunakan dan bisa dikonversi ke berbagai format. 26. Which tool is used in the class for writing Python code? A) Jupyter Notebook. B) VSCode. C) Google Colab. D) PyCharm. Show Answer Correct Answer: C) Google Colab. 27. What is a variable in programming? A) The output of a program. B) A type of error. C) A name given to a value that can be used and changed in a program. D) A number that never changes. Show Answer Correct Answer: C) A name given to a value that can be used and changed in a program. 28. What is mentioned as an additional advantage of Python in terms of obtaining, installing, and deploying? A) Python is expensive. B) Python is closed source. C) Python is free, open, and multiplatform. D) None of the above. Show Answer Correct Answer: C) Python is free, open, and multiplatform. 29. What will be the output after the following statements?a = 4*3**2 print(a) A) 144. B) 24. C) 32. D) 36. Show Answer Correct Answer: D) 36. 30. What happens if you pass more arguments than the number of parameters in a function? A) It raises an error. B) It ignores the extra arguments. C) It returns None. D) It stores extra arguments for later use. Show Answer Correct Answer: A) It raises an error. 31. Apa fungsi yang digunakan untuk membaca input dari pengguna di Python? A) Get input(). B) Read(). C) Fetch input(). D) Input(). Show Answer Correct Answer: D) Input(). 32. Identify the control structure used in the following code:for i in range(5):print(i) A) Selection. B) Iteration. C) Sequence. D) None of the above. Show Answer Correct Answer: B) Iteration. 33. How do you rename a module during import? A) From module name as alias name. B) From module name rename alias name. C) Import alias name from module name. D) Import module name as alias name. Show Answer Correct Answer: D) Import module name as alias name. 34. How can you check for missing values in a Pandas DataFrame df? A) Df.check null(). B) Df.hasna(). C) Df.isnull(). D) Df.null(). Show Answer Correct Answer: C) Df.isnull(). 35. Which value is an Integer? A) "cat". B) True. C) 64. D) 0.5. Show Answer Correct Answer: C) 64. 36. Mengapa data scientist perlu belajar pemrograman? A) Untuk menerapkan metode analisis dan pemodelan data yang sesuai. B) Untuk membuat visualisasi data yang menarik dan informatif. C) Semua jawaban benar. D) Untuk mengolah data dengan lebih efisien dan efektif. Show Answer Correct Answer: C) Semua jawaban benar. 37. What will the following code result in:name = "Alison" number = len(name) print(number) A) 7. B) 5. C) 6. D) 4. Show Answer Correct Answer: C) 6. 38. What is the order of precedence in python? A) Exponential, Parentheses, Multiplication, Division, Addition, Subtraction. B) Parentheses, Exponential, Multiplication, Addition, Division, Subtraction. C) Exponential, Parentheses, Division, Multiplication, Addition, Subtraction. D) Parentheses, Exponential, Multiplication, Division, Addition, Subtraction. Show Answer Correct Answer: D) Parentheses, Exponential, Multiplication, Division, Addition, Subtraction. 39. Select the valid Octal integer literals A) 0x1726. B) 0836. C) 07362. D) 7976. Show Answer Correct Answer: C) 07362. 40. Loop for disebut counted loop karena ..... A) Mengulang tanpa batas. B) Harus menggunakan angka genap. C) Tidak memiliki indeks karena jarak nya sangat jauh dari kode tersebut. D) Jumlah pengulangannya sudah diketahui. Show Answer Correct Answer: D) Jumlah pengulangannya sudah diketahui. 41. How is 2 represented in binary? A) 011. B) 001. C) 000. D) 010. Show Answer Correct Answer: D) 010. 42. How do you define(assign) variables? A) Var="String". B) Func==Hello. C) Var:123. D) Word= Hello. Show Answer Correct Answer: A) Var="String". 43. Python statements are put into a text file with a ".py" extension. The python interpreter is run, pointed at the file. The program is executed line-by-line and the output is displayed. A) Interactive mode. B) Script mode. C) Sandbox. D) Interpreter. Show Answer Correct Answer: B) Script mode. 44. Which of the following is FALSE about compilers? A) They translate a program written in a high-level language into machine code. B) Compiled code can be used multiple times without recompilation. C) If an error is found in a line, the compiler pauses the translation and prompts the user to correct the error. D) It optimises the code. Show Answer Correct Answer: C) If an error is found in a line, the compiler pauses the translation and prompts the user to correct the error. 45. What is a Boolean value in Python? Give an example. A) True and False are the two Boolean values in Python. B) On and Off. C) Yes and No. D) True and Maybe. Show Answer Correct Answer: A) True and False are the two Boolean values in Python. 46. What will be the output of the following code?x = 5y = 2print(x ** y) A) 52. B) 25. C) 10. D) 7. Show Answer Correct Answer: B) 25. 47. What is the output of the following Python code? print("2" + "5") A) Error. B) 10. C) 7. D) 25. Show Answer Correct Answer: D) 25. 48. What is the purpose of the 'drop()' method in a DataFrame? A) To sort the DataFrame by a specific column. B) To delete rows or columns from the DataFrame. C) To merge two DataFrames together. D) To add new rows to the DataFrame. Show Answer Correct Answer: B) To delete rows or columns from the DataFrame. 49. In the following, x = 7 the x would be considered a(n) A) Command. B) Parameter. C) String. D) Variable. Show Answer Correct Answer: D) Variable. 50. What does the message 'Setup was successful' indicate in the Python installation process? A) The installation failed. B) The installation was successful. C) The installation is pending. D) The installation was canceled. Show Answer Correct Answer: B) The installation was successful. 51. Which of these is not a component of a variable A) NUMERIC. B) VALUE. C) TYPE. D) IDENTITIY. Show Answer Correct Answer: A) NUMERIC. 52. What is the output of the following code? "'pythonnumbers = [10, 20, 30]numbers[2] = 50print(numbers) "' A) [10, 20, 50]. B) [50, 20, 30]. C) [10, 50, 30]. D) [10, 20, 30]. Show Answer Correct Answer: A) [10, 20, 50]. 53. What is the result of the following code:fname= "Esslam "lname= "Fahmi "print ("Hi" , lname + fname) A) Hi there. B) Hi fname lname. C) Hi Fahmi Esslam. D) Hi Esslam fahmi. Show Answer Correct Answer: C) Hi Fahmi Esslam. 54. How do you create a list in Python with the elements 1, 2, and 3? A) 'list = [1, 2, 3]'. B) 'list = <1, 2, 3>'. C) 'list = (1, 2, 3)'. D) 'list = {1, 2, 3}'. Show Answer Correct Answer: A) 'list = [1, 2, 3]'. 55. Given t = (10, 20, 30, 40), which expression retrieves the second element using zero-based indexing? A) T[2]. B) T[-1]. C) T[0]. D) T[1]. Show Answer Correct Answer: D) T[1]. 56. Which command is used to display a message on the screen in Python? A) Print. B) Display. C) Echo. D) Show. Show Answer Correct Answer: A) Print. 57. Which loop is used to iterate over a sequence in Python? A) Foreach loop. B) Repeat-until loop. C) Do-while loop. D) For loop. Show Answer Correct Answer: D) For loop. 58. Identify the invalid identifier. A) Keyword. B) And. C) Operator. D) Token. Show Answer Correct Answer: B) And. 59. In Python values that can not be changed after they are created are called A) Indestructable. B) Immutable. C) Independent. D) Invincible. Show Answer Correct Answer: B) Immutable. 60. Identifiers in Python must start with which of the following? A) A space. B) A number. C) An underscore. D) A special character. Show Answer Correct Answer: C) An underscore. ← 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