This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 16 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 16 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Comments in Python are written with a special character, which one? A) Brackets. B) Hashtag. C) Coma. D) None of the above. Show Answer Correct Answer: B) Hashtag. 2. What is a computer program? A) A physical part of the computer. B) A type of computer virus. C) A set of instructions written to perform a specific task. D) A device used for storing data. Show Answer Correct Answer: C) A set of instructions written to perform a specific task. 3. What will the following code print? "'pythonfor i in range(3):print("Python") "' A) Python Python. B) Python Python Python. C) Python. D) Error. Show Answer Correct Answer: B) Python Python Python. 4. What button do you press to compile (run) your program so that it runs in the shell? A) F3. B) F5. C) F7. D) F9. Show Answer Correct Answer: B) F5. 5. X=3x+1print(x) A) 4. B) 3. C) 3.0. D) 4.0. Show Answer Correct Answer: B) 3. 6. What is the output of the given Python code:print("ab", "cd", "ef", sep='*') A) Ab, cd, ef. B) Ab*cd*ef. C) Ab cd ef. D) Ab*cd*ef*. Show Answer Correct Answer: B) Ab*cd*ef. 7. Which symbol stands for divide? A) *. B) /. C) +. D) -. Show Answer Correct Answer: B) /. 8. A = 5a = 83print(a)When this program is executed, what will be displayed on the screen? A) 5. B) 83. C) 88. D) 5 83. E) There is an error in the program because variable a cannot hold two values at the same time. Show Answer Correct Answer: B) 83. 9. Which of the following variable names is NOT valid in Python? A) First name. B) 2ndPlace. C) UserAge. D) Total weight. Show Answer Correct Answer: B) 2ndPlace. 10. Which operator is used for 'not equal'? A) !=. B) ==. C) =. D) ><. Show Answer Correct Answer: A) !=. 11. What will be the output of the following code? "'pythonlength = 5width = 2print(length * width, "metres") "' A) 10 metres. B) 7 metres. C) 5 metres. D) 2 metres. Show Answer Correct Answer: A) 10 metres. 12. What data type is used for text in Python? A) Str. B) Int. C) Float. D) List. Show Answer Correct Answer: A) Str. 13. Which of the following is NOT a valid variable name in Python? A) Item price. B) Total. C) My salary. D) Age25. Show Answer Correct Answer: C) My salary. 14. What is the output of the following code:print('Hello, World!')? A) 'Hello, World!'. B) Error. C) Hello World!. D) Hello, World!. Show Answer Correct Answer: D) Hello, World!. 15. Which of the following statements will print the value of variable 'weight' in pounds? A) Print(weight, "pounds"). B) Print("pounds", weight). C) Print("weight pounds"). D) Print(pounds, weight). Show Answer Correct Answer: A) Print(weight, "pounds"). 16. Which of the following is NOT a valid Python variable name? A) 'student name'. B) '2nd place'. C) 'place2'. D) 'studentName'. Show Answer Correct Answer: B) '2nd place'. 17. Is the type of errors that happens when the computer is not able to make the conversion reliably A) Syntax error. B) Compilation error. C) Run-time error. D) Semantic errors. E) Logical error. Show Answer Correct Answer: B) Compilation error. 18. What are the main features of Python? A) Main features of Python include simplicity and readability, support for multiple programming paradigms, a large standard library, dynamic typing, and being an interpreted language. B) Requires complex syntax for basic tasks. C) Has a small standard library. D) Supports only procedural programming. Show Answer Correct Answer: A) Main features of Python include simplicity and readability, support for multiple programming paradigms, a large standard library, dynamic typing, and being an interpreted language. 19. What will the following recursive function return?def sum ..... range(n):if n <= 0:return 0return n + sum ..... range(n-1)print(sum ..... range(5)) A) 5. B) 10. C) 15. D) 20. Show Answer Correct Answer: C) 15. 20. What is the purpose of a syntax error in Python? A) To indicate an error in the program's structure. B) To execute a specific task in the program. C) To add more information to the code. D) To enhance the performance of the program. Show Answer Correct Answer: A) To indicate an error in the program's structure. 21. All computer programs must be written in the python shell. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 22. Python supports dynamic typing. A) False. B) True. C) Depends on the version. D) Not applicable. Show Answer Correct Answer: B) True. 23. What data type is a in this code:a = "5" A) Integer. B) Float. C) Boolean. D) String. Show Answer Correct Answer: D) String. 24. Which data type is used to represent whole numbers in Python? A) Float. B) String. C) Boolean. D) Int. Show Answer Correct Answer: D) Int. 25. What operator would I need to add 5 and 10? A) +. B) -. C) *. D) /. Show Answer Correct Answer: A) +. ← 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