This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 86 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 86 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. An expression like 2 + 2 in Python consists of ..... A) Values & Operators. B) Math. C) Variables. D) Commands. Show Answer Correct Answer: A) Values & Operators. 2. What widget would you use to display a single line of text input in Tkinter? A) Label. B) Entry. C) Text. D) Button. Show Answer Correct Answer: B) Entry. 3. Can selenium be used for automation? A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 4. What does the keyword 'if' represent in Python? A) The 'if' keyword represents a conditional statement in Python. B) The 'if' keyword is used to declare variables in Python. C) The 'if' keyword is used for defining functions in Python. D) The 'if' keyword is a loop control statement in Python. Show Answer Correct Answer: A) The 'if' keyword represents a conditional statement in Python. 5. Is this the correct code for a list?register = \{"Sam", "Pheobe", Georgia", Richard"\} A) Yes. B) No. C) All the above. D) None of the above. Show Answer Correct Answer: B) No. 6. To execute a Python program, you need a Python interpreter. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 7. What will the following code output if the variable 'age' is set to 12? 'print("You are '' + str(age) + '' years old.")' A) You are 12 years old. B) You are age years old. C) You are "12" years old. D) Error. Show Answer Correct Answer: A) You are 12 years old. 8. Which one is the assignment operator? A) =. B) ==. C) +. D) :. Show Answer Correct Answer: A) =. 9. Which keyword is used for function? A) Define. B) Def. C) Fun. D) Function. Show Answer Correct Answer: B) Def. 10. What is the output of the following code? "'pythonprint("The length is", 5, "metres.") "' A) The length is 5 metres. B) The length is5metres. C) The length is, 5, metres. D) The length is 5metres. Show Answer Correct Answer: A) The length is 5 metres. 11. What is the purpose of the pass keyword in Python? A) To terminate a loop. B) To skip the current iteration. C) To define an empty block of code. D) To declare a variable. Show Answer Correct Answer: C) To define an empty block of code. 12. In programming, which word means to break something down into smaller chunks? A) Chop. B) Decompose. C) Slice. D) Remove. Show Answer Correct Answer: B) Decompose. 13. You can check code in the Python A) Interactive mode. B) IDLE. C) Script mode. D) N.A. Show Answer Correct Answer: A) Interactive mode. 14. Which expression converts numbers = (1, 5, 7, 1) into a mutable collection? A) Tuple(numbers) returns a list. B) Numbers.append(2) returns a list. C) List(numbers) returns a list. D) Sorted(numbers, reverse=True) returns a list. Show Answer Correct Answer: C) List(numbers) returns a list. 15. How do you write the number ten as a string in Python? A) "10". B) 10. C) 'ten'. D) Ten. Show Answer Correct Answer: A) "10". 16. Which statement will print the temperature in Celsius entered by the user? A) Print("Temperature in Celsius:'' + input()). B) Print("Temperature in Celsius: ", input()). C) Print("Temperature in Celsius:'' + str(input())). D) Print("Temperature in Celsius:'' + str(temp)). Show Answer Correct Answer: C) Print("Temperature in Celsius:'' + str(input())). 17. Which of the following keywords is used to create an anonymous function in Python? A) Lambda. B) Anon. C) Def. D) Unknown. Show Answer Correct Answer: A) Lambda. 18. For i in range(1, 4):print(i)#end loop A) 1, 2, 3end loop. B) Error. C) 1, 2, 3, 4. D) 1, 2, 3. Show Answer Correct Answer: D) 1, 2, 3. 19. What will be the output of the following code? "'pythonprint("Python"[3]) "' A) H. B) T. C) O. D) Y. Show Answer Correct Answer: A) H. 20. Which statement is used for decision making in Python? A) For. B) While. C) If. D) Print. Show Answer Correct Answer: C) If. 21. Which of the following is true about the while loop? A) Executes until the condition becomes true. B) Executes until the condition becomes false. C) Executes a fixed number of times. D) Executes at least once. Show Answer Correct Answer: B) Executes until the condition becomes false. 22. Which mode of Python Interpreter allows to execute multiple statements saved in a file with extension .py ( can be Module/Script/Program file) A) Interactive Mode. B) Immediate Mode. C) Script Mode. D) Command Mode. Show Answer Correct Answer: C) Script Mode. 23. Which function is used to convert a number or string to an integer in Python? A) Str(). B) Float(). C) Int(). D) Bool(). Show Answer Correct Answer: C) Int(). 24. What is the memory location name known as in Python. When using this high level language? A) Float. B) Variable. C) Very. D) Number. Show Answer Correct Answer: B) Variable. 25. What is the result of the expression 5 + 3 in Python? A) 8. B) 10. C) 9. D) 6. Show Answer Correct Answer: A) 8. ← 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