This quiz works best with JavaScript enabled. Home > Cbse > Class 11 > Science > Computer Science > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 25 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 25 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What is the significance of Python's readability? A) Python's syntax is more complex than other languages. B) Python's readability enhances code maintainability, collaboration, and reduces errors. C) Python's readability slows down execution speed. D) Readability is not important in programming languages. Show Answer Correct Answer: B) Python's readability enhances code maintainability, collaboration, and reduces errors. 2. Which of the following best describes the output of a program that reads student details (Name, USN, Marks in three subjects) and displays the student details, total marks, and percentage with suitable messages? A) It displays student details, total marks, and percentage. B) It only displays the student name and USN. C) It displays only the marks in three subjects. D) It displays only the percentage. Show Answer Correct Answer: A) It displays student details, total marks, and percentage. 3. Name one use case of Python. A) Web development. B) Game development. C) Machine learning. D) Data analysis. Show Answer Correct Answer: A) Web development. 4. To stop the turtle drawing you need to use which of the following commands? A) Penup( ):. B) Penup( ). C) Penup:. D) Pen up( ). Show Answer Correct Answer: B) Penup( ). 5. What is the correct way to create a variable in Python? A) X = 10. B) 10 = x. C) Var x = 10. D) Int x = 10. Show Answer Correct Answer: A) X = 10. 6. Module-2:Dictionaries and Structuring Data are covered in which chapters of Textbook 1? A) Chapters 9-10. B) Chapters 4-5. C) Chapters 1-3. D) Chapters 6-8. Show Answer Correct Answer: B) Chapters 4-5. 7. Where can you download PyCharm? A) From the Python official website. B) From the JetBrains website. C) From GitHub. D) From a third-party software repository. Show Answer Correct Answer: B) From the JetBrains website. 8. Why is Python called Python? A) It is named after a comedy group. B) It is named after a famous scientist. C) It is named after a snake. D) It was the first programming language ever made. Show Answer Correct Answer: A) It is named after a comedy group. 9. Which one of the following is the correct extension of the Python file? A) .py. B) .python. C) .p. D) None of these. Show Answer Correct Answer: A) .py. 10. What is the purpose of syntax in text-based programming languages? A) To guide how statements and phrases are constructed. B) To confuse programmers. C) To slow down program execution. D) To hide errors. Show Answer Correct Answer: A) To guide how statements and phrases are constructed. 11. A location in memory used to store data that can be changed. A) Iteration. B) Constant. C) Value. D) Variable. Show Answer Correct Answer: D) Variable. 12. Python is a text-based programming language A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 13. The second part of if, that is executed when the condition is false A) For. B) If. C) Else. D) Input. Show Answer Correct Answer: C) Else. 14. What will be the value of 'x' after executing the following code? "'pythonx = 5x = x + 2 "' A) 2. B) 5. C) 7. D) 10. Show Answer Correct Answer: C) 7. 15. This data type is used to store whole numbers A) Double. B) String. C) Boolean. D) Integer. Show Answer Correct Answer: D) Integer. 16. What does the double-slash // do in Python? A) Normal division. B) Rounding-down division. C) Multiplication. D) Addition. Show Answer Correct Answer: B) Rounding-down division. 17. What is the result of the following expression:$7 // 2$ A) 4. B) 3. C) 3.5. D) 2. Show Answer Correct Answer: B) 3. 18. B = 24a = 10print(a, b)When this program is executed, what will be displayed on the screen? A) 10 24. B) 24 10. C) A b. D) There is an error in the program because variables a and b are not assigned values in the right order. Show Answer Correct Answer: A) 10 24. 19. What is the output of print('OK')? A) OK. B) Error. C) Nothing. D) None of the above. Show Answer Correct Answer: A) OK. 20. What is recursion in programming? A) Recursion is a method where a function solves a problem by calling itself. B) Recursion is a method of storing data in a database. C) Recursion is when a function is executed only once in a program. D) Recursion is a technique where a function runs in parallel with another function. Show Answer Correct Answer: A) Recursion is a method where a function solves a problem by calling itself. 21. Which of the following is a correct while loop in Python? A) While (x < 5). B) While x < 5;. C) While x < 5. D) While x < 5:. Show Answer Correct Answer: D) While x < 5:. 22. Web scraping is used in Data analytics. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 23. What is the output of the expression '5' * 2? A) 55. B) 5. C) Error. D) 10. Show Answer Correct Answer: A) 55. 24. ..... function is an anonymous function in python. A) Def. B) Lambda. C) Recursion. D) User defined. Show Answer Correct Answer: B) Lambda. 25. Which of the following is NOT a data type in Python? A) Float. B) Character. C) String. D) Integer. Show Answer Correct Answer: B) Character. 26. What is one feature that makes Python suitable for AI? A) High execution speed. B) Limited support for data visualization. C) Strictly typed language. D) Rich ecosystem of libraries and frameworks. Show Answer Correct Answer: D) Rich ecosystem of libraries and frameworks. 27. Which statement will display square of number (n)? A) Only First. B) All of the above. C) Print(math.pow(n, 2)) # math module is already imported. D) Print(n * n). Show Answer Correct Answer: B) All of the above. 28. In the line of code below, what does input() do?firstname = input( "What is your name?" ) A) Sets the variable to a random number. B) Asks the user to enter some data and saves this as the variable 'firstname'. C) It just prints a message on the screen. D) None of the above. Show Answer Correct Answer: B) Asks the user to enter some data and saves this as the variable 'firstname'. 29. In Python list indexes start at which number? A) 0. B) 1. C) -1. D) None (no number). Show Answer Correct Answer: A) 0. 30. Which of the following is a reserved word in Python? A) Function. B) Print. C) Def. D) Variable. Show Answer Correct Answer: C) Def. 31. True or False:Indentation in Python is for readability only. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 32. What symbol do we use when we want to add comments to a python program? A) %. B) (). C) **. D) #. Show Answer Correct Answer: D) #. 33. For nums = (4, 7, 4, 9, 4). Which expression gives the position of the first 4? A) Nums.index(4) returns position. B) Nums[4] returns position. C) 4 in nums returns position. D) Nums.count(4) returns position. Show Answer Correct Answer: A) Nums.index(4) returns position. 34. What keeps a record of every version of a file that has been saved to your Google Docs cloud account? A) Version history. B) Recent history. C) All the above. D) None of the above. Show Answer Correct Answer: A) Version history. 35. What is the output of the below code snippet?num1=10num2=7//2num2*=num1print(num2) A) 30. B) 30.0. C) 10. D) 35.0. Show Answer Correct Answer: A) 30. 36. What happens when 'time.sleep()' is executed in a program? A) The program immediately terminates. B) The program outputs the current system time. C) The program runs faster for the given number of seconds. D) The current process is suspended for the given number of seconds, then resumes at the next line of the program. Show Answer Correct Answer: D) The current process is suspended for the given number of seconds, then resumes at the next line of the program. 37. Name numeric data types in Python? A) Integer and float. B) String. C) Array. D) All of the above. Show Answer Correct Answer: A) Integer and float. 38. X, y=5, 6print(x==5 and y==6) A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 39. They expect to see 10, but they see the word score instead. Why? A) Variables cannot be printed. B) Quotes tell Python it is text, not a variable. C) Python always prints variable names first. D) Print() can only print numbers. Show Answer Correct Answer: B) Quotes tell Python it is text, not a variable. 40. What is the output of the following code?print("The answer is", 3 + 2) A) The answer is 6. B) The answer is 3 + 2. C) The answer is 32. D) The answer is 5. Show Answer Correct Answer: D) The answer is 5. 41. Statement below 'function definition' begin with spaces called ..... A) Indentation. B) Condition. C) Definition. D) None of the above. Show Answer Correct Answer: A) Indentation. 42. Which statement is used to stop a loop in Python? A) End. B) Stop. C) Exit. D) Break. Show Answer Correct Answer: D) Break. 43. Is a comment ignored or followed by a program? A) Executed. B) Displayed. C) Ignored. D) Processed. Show Answer Correct Answer: C) Ignored. 44. What is pseudocode? A) A representation of an algorithm in English. B) A graphical programming language. C) A system for representing codes in python. D) A standard mapping of numbers to letters. Show Answer Correct Answer: A) A representation of an algorithm in English. 45. What will print('school'[0]) output? A) L. B) S. C) H. D) O. Show Answer Correct Answer: B) S. 46. What is the index of the last element in a list called 'items' with 5 elements? A) '0'. B) '4'. C) '-1'. D) '5'. Show Answer Correct Answer: B) '4'. 47. How can you make the turtle pen up and stop drawing? A) Use the command 'lift()'. B) Use the command 'penup()'. C) Use the command 'pendown()'. D) Use the command 'stopdrawing()'. Show Answer Correct Answer: B) Use the command 'penup()'. 48. What is the purpose of the 'input' subprogram in PLS? A) Adds an item to the end of the list. B) Displays the content of prompt to the screen and waits for user input. C) Generates a list of numbers. D) Removes the item at a specific index from a list. Show Answer Correct Answer: B) Displays the content of prompt to the screen and waits for user input. 49. What type of error is returned by the following statement? def abc(a):print(a) A) ErrorIndentation. B) SpaceError. C) No error in the given statement. D) IndentationError. Show Answer Correct Answer: D) IndentationError. 50. Answer = 2 + 12 * 2 print("The Answer is", answer)When this program is executed, what will be displayed on the screen? A) The Answer is answer. B) The Answer is 28. C) The Answer is 26. D) The Answer is 2 + 12 * 2. Show Answer Correct Answer: C) The Answer is 26. 51. How do you handle errors in Python to prevent your programme from crashing? A) Using if statements. B) Using try and except blocks. C) Using print statements. D) Using for loops. Show Answer Correct Answer: B) Using try and except blocks. 52. What will the following code output?for i in range(2, 7, 2):print(i) A) 2, 3, 5. B) 2, 3, 4, 5, 6. C) 2, 5, 6. D) 2, 4, 6. Show Answer Correct Answer: D) 2, 4, 6. 53. How many types of switch cases are there in total? A) 6. B) 7. C) 11. D) 9. Show Answer Correct Answer: A) 6. 54. Which operator returns True if target string is somewhere in the search string; otherwise it returns False. A) Is. B) In. C) !=. D) ==. Show Answer Correct Answer: B) In. 55. Which data type than can have one of two values:True or False? A) Boolean. B) Modulo. C) Variable. D) Interpreter. Show Answer Correct Answer: A) Boolean. 56. Is print a predefine function in Python? A) Its a variable. B) Yes. C) Its a integer. D) No. Show Answer Correct Answer: B) Yes. 57. Which of the following is not a token? A) 23. B) ##. C) //. D) "X". Show Answer Correct Answer: B) ##. 58. What is the purpose of the else block in a loop? A) Executes only if the loop condition is false. B) Executes if the loop runs completely without a break. C) Executes at the beginning of the loop. D) None of the above. Show Answer Correct Answer: B) Executes if the loop runs completely without a break. 59. What is the purpose of the getPixel function? A) To change the color of a specific pixel. B) To get the color information of a specific pixel. C) To get the width of the picture. D) To get the height of the picture. Show Answer Correct Answer: B) To get the color information of a specific pixel. 60. What will the following Python program print if the user enters 20 as their age? age = int(input('Enter your age:'))if age >= 18:print('Adult')else:print('Child') A) Nothing. B) Error. C) Adult. D) Child. Show Answer Correct Answer: C) Adult. ← PreviousNext →Related QuizzesScience QuizzesClass 11 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 8 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books