This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 1 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 1 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What is the purpose of the "import requests" statement in a Python file? A) To install the requests library. B) To update the requests library. C) To use the requests library in the code. D) To delete the requests library. Show Answer Correct Answer: C) To use the requests library in the code. 2. Which of the following is a valid way to assign the value 25 to a variable named 'age' in Python? A) 'age == 25'. B) 'age = 25'. C) '25 = age'. D) 'age:= 25'. Show Answer Correct Answer: B) 'age = 25'. 3. What operator would I need to take 5 from 10? A) -. B) *. C) +. D) /. Show Answer Correct Answer: A) -. 4. What is an interpreted language? A) An interpreted language is executed directly by an interpreter at runtime. B) An interpreted language is only used for web development. C) An interpreted language is compiled before execution. D) An interpreted language requires a virtual machine to run. Show Answer Correct Answer: A) An interpreted language is executed directly by an interpreter at runtime. 5. What does the 'sequence' in programming constructs refer to? A) The order in which variables are declared. B) The indentation of code segments. C) The execution of instructions one after another from the top to the bottom of the file. D) The loop that executes while a condition is true. Show Answer Correct Answer: C) The execution of instructions one after another from the top to the bottom of the file. 6. Keyword mana yang digunakan untuk mendefinisikan fungsi di Python? A) Lambda. B) Define. C) Function. D) Def. Show Answer Correct Answer: D) Def. 7. What is the output of the following code?x = 10; print(x + 5) A) 10. B) 15. C) 5. D) 20. Show Answer Correct Answer: B) 15. 8. What does the string subprogram .find() return if the is not found in? A) 0. B) 1. C) -1. D) An exception. Show Answer Correct Answer: C) -1. 9. How do you define a function in Python? A) Function name(parameters) =>. B) Def function name(parameters):. C) Function function name(parameters). D) Create function name(parameters). Show Answer Correct Answer: B) Def function name(parameters):. 10. Who created Python? A) James Gosling. B) Bjarne Stroustrup. C) Dennis Ritchie. D) Guido van Rossum. Show Answer Correct Answer: D) Guido van Rossum. 11. What does the turtle library subprogram 'penup()' do? A) Changes the color of the pen. B) Draws a circle. C) Puts the pen down. D) Lifts the pen up. Show Answer Correct Answer: D) Lifts the pen up. 12. A syntax error means your code has a 'grammar' mistake or you used symbols/operationsincorrectly A) False. B) True. C) All the above. D) None of the above. Show Answer Correct Answer: B) True. 13. Which data structure stores elements as key-value pairs? A) List. B) Tuple. C) Set. D) Dictionary. Show Answer Correct Answer: D) Dictionary. 14. What is the output of the following code snippet?my ..... list = [1, 2, 3, 4, 5] print(len(my ..... list)) A) 3. B) 6. C) 2. D) 5. Show Answer Correct Answer: D) 5. 15. Which function is used to get user input? A) Read(). B) Input(). C) Scan(). D) Get(). Show Answer Correct Answer: B) Input(). 16. In which year was Python created? A) 1991. B) 2000. C) 1995. D) 1989. Show Answer Correct Answer: A) 1991. 17. List are the simple definition of Python Programming, EXCEPT ..... A) Low Level. B) Interpreted. C) Object Oriented. D) Interactive. Show Answer Correct Answer: A) Low Level. 18. Which of the following is the correct way to assign the value 25 to a variable called 'distance'? A) Distance == 25. B) Distance:= 25. C) Distance = 25. D) 25 = distance. Show Answer Correct Answer: C) Distance = 25. 19. Read the Python program below:b = 42 a = 13print(a, b)When this program is executed, what will be displayed on the screen? A) 13 42. B) 42 13. C) A b. D) There is an error in the program because variables a and b are not assigned values in the right order. Show Answer Correct Answer: A) 13 42. 20. What will print(type(5)) output? A) Int. B) Float. C) Str. D) Bool. Show Answer Correct Answer: A) Int. 21. What is the purpose of the 'pass' keyword in exception handling? A) To raise an exception. B) To ignore the exception. C) To handle the exception. D) To print the exception. Show Answer Correct Answer: B) To ignore the exception. 22. What is a variable in Python? A) A container for storing data. B) A function. C) A type of loop. D) A fixed value. Show Answer Correct Answer: A) A container for storing data. 23. Which of the following is valid operator? A) It. B) On. C) In. D) At. Show Answer Correct Answer: C) In. 24. Which extension is used for Python files? A) .py. B) .txt. C) .cpp. D) .java. Show Answer Correct Answer: A) .py. 25. Which command allows the user to type answers? A) Print(). B) Input(). C) Query(). D) Ask(). Show Answer Correct Answer: B) Input(). Next →Related QuizzesClass 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 10Class 11 Computer Science Chapter 2 Introduction To Python Quiz 11 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books