This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 87 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 87 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What will the following code output? "'pythontemperature = 20if temperature > 25:print("It's hot")else:print("It's cool") "' A) It's hot. B) It's cool. C) Error. D) Nothing. Show Answer Correct Answer: B) It's cool. 2. Which of the following is a correct if statement in Python? A) 'if x = 5:'. B) 'if x == 5:'. C) 'if (x == 5)'. D) 'if x:= 5'. Show Answer Correct Answer: B) 'if x == 5:'. 3. What will happen if you call a function with fewer arguments than required, but no default values are provided? A) Function will ignore the missing arguments. B) Function will give an error message. C) Function will return None. D) Function will set remaining arguments to 0. Show Answer Correct Answer: B) Function will give an error message. 4. Which of the following is a correct way to assign strings with multiple lines in a variable? A) '' '' '' lines '' '' ''. B) ' lines '. C) '' lines ''. D) '' '' lines '' ". Show Answer Correct Answer: A) '' '' '' lines '' '' ''. 5. Write the output of the following code:x=2; y=3; x+y+5; print(x+y) A) 5. B) None of the above. C) 10. D) Error. Show Answer Correct Answer: A) 5. 6. What is keyword? A) It is a meaningful word that has a specific task to execute. B) Letters on a keyboard. C) A keyboard. D) To help in sentences. Show Answer Correct Answer: A) It is a meaningful word that has a specific task to execute. 7. Which of the following is a valid way to create a tuple in Python? A) Tuple = \{\}. B) Tuple = <>. C) Tuple = (). D) Tuple = []. Show Answer Correct Answer: C) Tuple = (). 8. Which one is a Python keyword? A) Jump. B) Dance. C) If. D) Begin. Show Answer Correct Answer: C) If. 9. Describe the use of the 'continue' statement in a loop. A) The 'continue' statement skips the current iteration of a loop and continues with the next iteration. B) The 'continue' statement repeats the current iteration of the loop. C) The 'continue' statement pauses the loop for a specified time. D) The 'continue' statement terminates the loop immediately. Show Answer Correct Answer: A) The 'continue' statement skips the current iteration of a loop and continues with the next iteration. 10. How is Jython different from CPython? A) Jython is written in RPython. B) Jython is written in Java. C) Jython is a microcontroller-specific implementation. D) Jython is not compatible with Python 3. Show Answer Correct Answer: B) Jython is written in Java. 11. Your program asks people how much money something costs and saves it as a variable named "price" . Assuming users enter the amount correctly, which command will result in the value containing dollars AND cents. A) Cost = float(price). B) Cost = price. C) Cost = int(price). D) Cost = str(price). Show Answer Correct Answer: A) Cost = float(price). 12. What's the output of the below code snippet?from math import sqrtL1 = [x**2 for x in range(10)].pop()L1 += 19print(sqrt(L1), end = '' ")L1 = [x**2 for x in reversed(range(10))].pop()L1 += 16print(int(sqrt(L1))) A) 10.0 4. B) 4.35 4. C) 10 4. D) None of the above. Show Answer Correct Answer: A) 10.0 4. 13. Apa output dari print(2 ** 3)? A) 4. B) 8. C) 6. D) 9. Show Answer Correct Answer: B) 8. 14. Code forb is greater than a A) A = 33b = 200if b > a:print("b is greater than a"). B) A = 33b = 200if b < a:print("b is greater than a"). C) A = 330b = 200if b > a:print("b is greater than a"). D) None of the above. Show Answer Correct Answer: A) A = 33b = 200if b > a:print("b is greater than a"). 15. What is the data type of x after the following statement?x = [7, 8, 9, 10] A) List. B) Dictionary. C) Set. D) Tuple. Show Answer Correct Answer: A) List. 16. What is the default mode for the PLS turtle when it is created? A) Logo. B) Standard. C) Extended. D) Simple. Show Answer Correct Answer: B) Standard. 17. Which function gives the length of a list? A) Count(). B) Length(). C) Len(). D) Size(). Show Answer Correct Answer: C) Len(). 18. What is the syntax used to ask something in Python? A) Ask(). B) Prompt(). C) Input(). D) Print(). Show Answer Correct Answer: C) Input(). 19. Which of the following statements will display the value stored in the variable 'height'? A) 'print(height)'. B) 'output(height)'. C) 'display(height)'. D) 'show(height)'. Show Answer Correct Answer: A) 'print(height)'. 20. What is the correct rule for naming variables in Python? A) A variable name can contain special characters. B) You can use any Python reserved word as a variable name. C) A variable name cannot start with a number. D) A variable name can contain only numbers and letters. Show Answer Correct Answer: C) A variable name cannot start with a number. 21. Each line or instruction typed is interpreted and executed immediately and results are displayed each time you press ENTER. A) Interactive mode. B) Script mode. C) Sandbox. D) Interpreter. Show Answer Correct Answer: A) Interactive mode. 22. Python is widely used in which specialized field due to its powerful libraries like Pandas and NumPy? A) Video Game Console Manufacturing. B) Advanced Rocket Propulsion Design. C) Data Science and Machine Learning. D) Operating System Kernel Development. Show Answer Correct Answer: C) Data Science and Machine Learning. 23. What is the output of the code:d1 = \{"john":40, "peter":45\} d2 = \{"john":466, "peter":45\} print d1 > d2 A) True. B) False. C) Not applicable. D) None of the above. Show Answer Correct Answer: B) False. 24. Which of these is a Python keyword? A) Banana. B) Def. C) Hello. D) Cool. Show Answer Correct Answer: B) Def. 25. Python uses ..... to convert its instructions into machine language. A) None of the above. B) Both of the above. C) Compiler. D) Interpreter. Show Answer Correct Answer: D) Interpreter. ← 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