This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 19 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 19 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What is the purpose of the 'else' statement in a conditional? A) The 'else' statement is used to define a new function. B) The 'else' statement is optional and has no effect on the code. C) The 'else' statement is only used in loops. D) The 'else' statement defines what to do when the 'if' condition is false. Show Answer Correct Answer: D) The 'else' statement defines what to do when the 'if' condition is false. 2. If a=\{5, 6, 7\}, what happens when a.add(5) is executed? A) A=\{5, 5, 6, 7\}. B) A=\{5, 6, 7\}. C) Error as there is no add function for set data type. D) Error as 5 already exists in the set. Show Answer Correct Answer: B) A=\{5, 6, 7\}. 3. What is the first program you should create in a new programming language? A) Print 'Hello world!'. B) Print 'Goodbye world!'. C) Print 'Hello Python!'. D) None of the above. Show Answer Correct Answer: A) Print 'Hello world!'. 4. What is the output of the following code? "'pythonprint("Python" + "3") "' A) Python 3. B) Python+3. C) Python3. D) Python, 3. Show Answer Correct Answer: C) Python3. 5. A step by step set of instructions used to solve a problem A) Algorithm. B) Function. C) Variable. D) None of the above. Show Answer Correct Answer: A) Algorithm. 6. What is the output of the below code?num ..... list = [10.5, 30.5, -1.20, 10.10]num ..... list.insert(-3, -10.5)num ..... list.pop(0)print(num ..... list[0]) A) 30.5. B) -10.5. C) 10.1. D) -1.2. Show Answer Correct Answer: B) -10.5. 7. X=6y=7X=4, 8print(x, y) A) (4, 8) 7. B) (4 8) 7. C) (4, 8) 7. D) (4, 8), 7. Show Answer Correct Answer: B) (4 8) 7. 8. Python is an example of a: A) Text-based programming language. B) Visual-based programming language. C) Block-based programming language. D) Language written in JavaScript. Show Answer Correct Answer: A) Text-based programming language. 9. Suppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], Which of the following is correct syntax for slicing operation? A) Print(list1[2:]). B) Print(list1[:2]). C) Print(list1[:-2]). D) All of the mentioned. Show Answer Correct Answer: D) All of the mentioned. 10. How do you write a conditional statement that prints "Hello" if the variable a is greater than 5? A) If a > 5:print("Hello"). B) If a > 5 then:print("Hello"). C) If (a > 5) \{ print("Hello") \}. D) If a > 5; print("Hello"). Show Answer Correct Answer: A) If a > 5:print("Hello"). 11. In python, decimal numbers are called A) Float. B) Floater. C) Bubbles. D) Balloon. Show Answer Correct Answer: A) Float. 12. Given t = (4, 2, 7, 2). Which statement correctly describes applying sorted(t)? A) Returns a tuple ordered ascending. B) Returns a list ordered ascending. C) Returns a list preserving original order. D) Returns a tuple removing duplicates. Show Answer Correct Answer: B) Returns a list ordered ascending. 13. How can you take an integer input from the user? A) X = input("Enter a number: "). B) X = int(input("Enter a number: ")). C) X = float(input("Enter a number: ")). D) X = str(input("Enter a number: ")). Show Answer Correct Answer: B) X = int(input("Enter a number: ")). 14. How do you check if 5 is more than 3? A) 5 > 3. B) 5 < 3. C) 5 = 3. D) 5 >> 3. Show Answer Correct Answer: A) 5 > 3. 15. What is the difference between a list and a tuple in Python? A) Lists can contain only numbers; tuples can contain any data type. B) Lists are faster than tuples in all cases. C) Lists are mutable; tuples are immutable. D) Tuples are mutable; lists are immutable. Show Answer Correct Answer: C) Lists are mutable; tuples are immutable. 16. A ..... is the smallest element of a python script that is meaningful to the interpreter? A) I. Boolean. B) String. C) TOKEN. D) NUMERIC. Show Answer Correct Answer: C) TOKEN. 17. What is the PLS equivalent for the data type 'integer'? A) Int. B) Float. C) Bool. D) Str. Show Answer Correct Answer: A) Int. 18. 'If' is a decision making statement A) TRUE. B) FALSE. C) All the above. D) None of the above. Show Answer Correct Answer: A) TRUE. 19. Who developed Python? A) Guido Van Rossum. B) James Gosling. C) Bjarne Stroustrup. D) Dennis Ritchie. Show Answer Correct Answer: A) Guido Van Rossum. 20. Which operator performs a multiplication? A) +. B) /. C) X. D) *. Show Answer Correct Answer: D) *. 21. What is the result of 3 + 5? A) 35. B) 8. C) 53. D) Error. Show Answer Correct Answer: B) 8. 22. Optional or default parameters in functions can be defined with: A) Optional arguments. B) Default arguments. C) Keyword arguments. D) Boolean arguments. Show Answer Correct Answer: C) Keyword arguments. 23. How do you create a new variable in Python? A) Let score = 0. B) Int score = 0. C) Score = 0. D) Var score = 0. Show Answer Correct Answer: C) Score = 0. 24. What is the result of the expression 5 + 3 * 2? A) 16. B) 13. C) 11. D) 10. Show Answer Correct Answer: C) 11. 25. Which of the following is not a use and application of Python? A) Research. B) Software Development. C) AI and Machine Learning. D) Internet of Things. Show Answer Correct Answer: B) Software Development. ← 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