This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 64 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 64 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What is the index of the last element in a list called 'items' with 5 elements? A) '4'. B) '5'. C) '-1'. D) '0'. Show Answer Correct Answer: A) '4'. 2. 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()'. 3. 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. 4. What type of error is returned by the following statement? def abc(a):print(a) A) SpaceError. B) IndentationError. C) ErrorIndentation. D) No error in the given statement. Show Answer Correct Answer: B) IndentationError. 5. 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 2 + 12 * 2. B) The Answer is 26. C) The Answer is 28. D) The Answer is answer. Show Answer Correct Answer: B) The Answer is 26. 6. 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. 7. What will the following code output?for i in range(2, 7, 2):print(i) A) 2, 3, 4, 5, 6. B) 2, 4, 6. C) 2, 3, 5. D) 2, 5, 6. Show Answer Correct Answer: B) 2, 4, 6. 8. How many types of switch cases are there in total? A) 6. B) 7. C) 9. D) 11. Show Answer Correct Answer: A) 6. 9. Which operator returns True if target string is somewhere in the search string; otherwise it returns False. A) ==. B) !=. C) Is. D) In. Show Answer Correct Answer: D) In. 10. Which data type than can have one of two values:True or False? A) Boolean. B) Variable. C) Modulo. D) Interpreter. Show Answer Correct Answer: A) Boolean. 11. Is print a predefine function in Python? A) Its a variable. B) Yes. C) No. D) Its a integer. Show Answer Correct Answer: B) Yes. 12. Which of the following is not a token? A) //. B) "X". C) ##. D) 23. Show Answer Correct Answer: C) ##. 13. Which Python function is used to get input from the user? A) 'print()'. B) 'input()'. C) 'read()'. D) 'scan()'. Show Answer Correct Answer: B) 'input()'. 14. 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. 15. What is the purpose of the getPixel function? A) To get the color information of a specific pixel. B) To change the color of a specific pixel. C) To get the width of the picture. D) To get the height of the picture. Show Answer Correct Answer: A) To get the color information of a specific pixel. 16. What is the output of the following code:print(5 > 3 and 2 < 4)? A) 2 > 4. B) True. C) False. D) 5 < 3. Show Answer Correct Answer: B) True. 17. Which among the following is not a feature of Python? A) Simplicity. B) Not portable. C) Open source. D) Extensible. Show Answer Correct Answer: B) Not portable. 18. 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) Adult. B) Child. C) Error. D) Nothing. Show Answer Correct Answer: A) Adult. 19. Is the statement valid/invalidx+1=x A) Valid. B) Invalid. C) All the above. D) None of the above. Show Answer Correct Answer: B) Invalid. 20. What will be the output of the following code:for i in range(3):print(i)? A) 1.5. B) 3. C) 012. D) -1. Show Answer Correct Answer: C) 012. 21. What should you do if you want to run your Python program? A) Select Run > Run Module. B) Select File > Save As. C) Select File > Open. D) Select File > Close. Show Answer Correct Answer: A) Select Run > Run Module. 22. Write the output of the following:def abc():print('abc') A) Abc. B) No Output. C) Error. D) 0. Show Answer Correct Answer: B) No Output. 23. Which function is used to get user input in Python 3? A) Get(). B) Input(). C) Scan(). D) Read(). Show Answer Correct Answer: B) Input(). 24. X = ['ab', 'cd']for i in x:i.upper()print(x) A) ['ab', 'cd']. B) ['AB', 'CD']. C) All the above. D) None of the above. Show Answer Correct Answer: A) ['ab', 'cd']. 25. What will be the output of the following code? "'pythonprint("5" + "6") "' A) 11. B) 56. C) 5 6. D) Error. Show Answer Correct Answer: B) 56. ← 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