This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 38 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 38 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Which of the following statements is true about Python lists? A) Lists are immutable. B) Lists can contain mixed data types. C) Lists are defined using \{\}. D) Lists cannot be nested. Show Answer Correct Answer: B) Lists can contain mixed data types. 2. Which of the following is the correct way to convert a string '"25"' to an integer in Python? A) Int("25"). B) Str(25). C) Float("25"). D) 25("int"). Show Answer Correct Answer: A) Int("25"). 3. What is the file format of Jupyter Notebook(Google Colab)? A) .jpg. B) .py. C) .ipynb. D) , js. Show Answer Correct Answer: C) .ipynb. 4. What is the purpose of the requestString() function? A) To request user input as a string. B) To print a string. C) To define a variable. D) None of the above. Show Answer Correct Answer: A) To request user input as a string. 5. How do you create a variable in Python? A) Use the syntax 'variable name = value' to create a variable. B) Assign a value with 'variable name:value'. C) Create a variable by writing 'variable name $\rightarrow$ value'. D) Declare a variable using 'value = variable name'. Show Answer Correct Answer: A) Use the syntax 'variable name = value' to create a variable. 6. What is an error? A) When your program has a problem. B) A type of variable. C) A programming function. D) None of the above. Show Answer Correct Answer: A) When your program has a problem. 7. Which of the following is a loop in Python? A) 'if'. B) 'else'. C) 'for'. D) 'elif'. Show Answer Correct Answer: C) 'for'. 8. What is the data type of L if L = [1, 'Python', 2.5]? A) List. B) String. C) Dictionary. D) Tuple. Show Answer Correct Answer: A) List. 9. How can you import only specific functions from a module? A) Import module name.function name. B) Import function from module name. C) From function name import module name. D) From module name import function name. Show Answer Correct Answer: D) From module name import function name. 10. Example of valid identifiers A) 12Name. B) Name$. C) Total-mark. D) Total marks. Show Answer Correct Answer: D) Total marks. 11. Which function is used to convert a number to a string in A) Str(). B) Int(). C) Float(). D) String(). Show Answer Correct Answer: A) Str(). 12. What is a programming language? A) English. B) A language for babies. C) A programming language is a vocabulary and a set a set of grammatical rules for instructing a computer or computing a device to perform specific tasks. D) A computer language. Show Answer Correct Answer: C) A programming language is a vocabulary and a set a set of grammatical rules for instructing a computer or computing a device to perform specific tasks. 13. Which line correctly converts a string to an integer? A) Int = "5". B) Score = int("5"). C) Score = input("5"). D) Score = "int(5)". Show Answer Correct Answer: B) Score = int("5"). 14. Which of the following is a valid way to comment in Python? A) /* This is a comment */. B) # This is a comment. C) // This is a comment. D) . Show Answer Correct Answer: B) # This is a comment. 15. What happens when you type print("3" + "4")? A) 7. B) 34. C) 3+4. D) Error. Show Answer Correct Answer: B) 34. 16. What is Python described as? A) A video game. B) A programming language. C) A math tool. D) A type of snake. Show Answer Correct Answer: B) A programming language. 17. What does the following code display?a = 1b = 2print(a + a) A) 2. B) 3. C) 4. D) 22. Show Answer Correct Answer: A) 2. 18. What is the output of the following code? "'pythonprint(len("Python")) "' A) 5. B) 6. C) 7. D) Error. Show Answer Correct Answer: B) 6. 19. Which of the following is NOT a programming paradigm supported by Python? A) Procedural programming. B) Object-oriented programming. C) Functional programming. D) Assembly programming. Show Answer Correct Answer: D) Assembly programming. 20. Which of the following is a boolean value in Python? A) "True". B) True. C) True. D) 1. Show Answer Correct Answer: B) True. 21. To repeat a task many times, we use a: A) If. B) While loop. C) Return. D) Print. Show Answer Correct Answer: B) While loop. 22. What is syntax in programming? A) The output of the code. B) A type of error. C) A programming language. D) The structure and rules that govern how code is written. Show Answer Correct Answer: D) The structure and rules that govern how code is written. 23. Which of the following is NOT a logical operator in Python? A) And. B) Or. C) Not. D) Xor. Show Answer Correct Answer: D) Xor. 24. Define the term syntax error A) The rule of language. B) English. C) All the above. D) None of the above. Show Answer Correct Answer: A) The rule of language. 25. Which data type represents a whole number? A) Integer. B) String. C) Float. D) Boolean. Show Answer Correct Answer: A) Integer. ← 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