This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 48 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 48 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What does it mean for Python to be dynamically typed? A) Variables must be declared with their types before use. B) Variables can change their types during runtime. C) Python automatically compiles the code. D) The code is written in modules. Show Answer Correct Answer: C) Python automatically compiles the code. 2. What type of error is demonstrated by the following code? x = "ABC" + 2 A) IndexError. B) NameError. C) SyntaxError. D) TypeError. Show Answer Correct Answer: D) TypeError. 3. Which is the best type of loop to write a file in? A) While loop. B) For loop. C) Repeat loop. D) None of the above. Show Answer Correct Answer: B) For loop. 4. What will happen if indentation is incorrect? A) An error will occur. B) The code will run. C) Nothing will happen. D) None of the above. Show Answer Correct Answer: A) An error will occur. 5. What operator would I need to divide 5 by 10? A) /. B) *. C) +. D) #. Show Answer Correct Answer: A) /. 6. What command would you use to move the turtle forward by 100 units? A) Backward(100). B) Forward(100). C) Move(100). D) Step(100). Show Answer Correct Answer: B) Forward(100). 7. What does the input() function return in Python? A) An integer. B) A float. C) A string. D) A list. Show Answer Correct Answer: C) A string. 8. What does the 'if' statement do in Python? A) Repeats a block of code. B) Checks a condition and executes a block of code if the condition is true. C) Defines a function. D) Declares a variable. Show Answer Correct Answer: B) Checks a condition and executes a block of code if the condition is true. 9. What is the value of $2 + 3$ A) 23. B) 5. C) 6. D) 8. Show Answer Correct Answer: B) 5. 10. What are the applications of Python? A) Web development. B) Artificial intelligence. C) Data science. D) All of the above. Show Answer Correct Answer: D) All of the above. 11. What is the purpose of the 'import ' statement in a program? A) To export the specified library module from the program. B) To modify the specified library module within the program. C) To import the module into the current program. D) To delete the specified library module from the program. Show Answer Correct Answer: C) To import the module into the current program. 12. How can you take user input in Python? A) Read() function. B) Get() function. C) Input() function. D) Scan() function. Show Answer Correct Answer: C) Input() function. 13. How do you access the first element of a list named 'fruits'? A) 'fruits[0]'. B) 'fruits[1]'. C) 'fruits.first()'. D) 'fruits[-1]'. Show Answer Correct Answer: A) 'fruits[0]'. 14. Which data type below is an int? A) "hello world". B) 12. C) 12.5. D) True. Show Answer Correct Answer: B) 12. 15. Before you can use a powerful external module, such as the math library or a custom module, what must you do first in your Python script? A) Save the file as a .pyc extension. B) Use the include statement. C) Run the install command. D) Use the import statement. Show Answer Correct Answer: D) Use the import statement. 16. What is the comparison operator for 'equal to' in Python? A) !=. B) <=>. C) ==. D) <>. Show Answer Correct Answer: C) ==. 17. What is the output of the following Python code? x = 10x = x + 1print(x) A) 11. B) 10. C) 12. D) 9. Show Answer Correct Answer: A) 11. 18. Is an example of what data type? A) String. B) Float. C) Boolean. D) None of the above. Show Answer Correct Answer: B) Float. 19. Which generation of computers used Transistor based hardware? A) First Generation. B) Second Generation. C) Third Generation. D) Fourth Generation. Show Answer Correct Answer: B) Second Generation. 20. What is the correct syntax for an if statement? A) If x = 5:. B) If (x == 5). C) If x == 5:. D) If x == 5. Show Answer Correct Answer: C) If x == 5:. 21. In Python a list slice from start to end can be used to A) Delete the list. B) Sort the list. C) Reverse the list. D) Copy the list. Show Answer Correct Answer: D) Copy the list. 22. Perbedaan utama tuple dan list adalah ..... A) Tuple dapat dimodifikasi. B) List tidak bisa diubah. C) Tuple tidak dapat dimodifikasi. D) Tuple hanya untuk angka. Show Answer Correct Answer: C) Tuple tidak dapat dimodifikasi. 23. Data = "No Way!" The expression len(data) evaluates to: A) 8. B) 7. C) 6. D) None of the above. Show Answer Correct Answer: B) 7. 24. How do you check the number of rows in a DataFrame? A) Using the shape attribute. B) Using the count() method. C) Using the length() function. D) Using the size property. Show Answer Correct Answer: A) Using the shape attribute. 25. Find the outputa = "5"print(type(a)) A) . B) . C) . D) None of the above. Show Answer Correct Answer: B) . ← 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