This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 9 Practical Work Python Exercises – Quiz 22 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 22 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. List items have an index number. In the following list, which item has the index number of 3?["John", "Harry", "Jesse", "John", "Harry", "Harry", "Jill"] A) "John". B) "Harry". C) "Jesse". D) "Jill". Show Answer Correct Answer: A) "John". 2. Correct file extension for python files? A) .py. B) .pyt. C) .pt. D) .pyth. Show Answer Correct Answer: A) .py. 3. Three of the for loops below will provide identical values for i. Which for loop will provide values that do not match the others? A) For i in range(0, 5):. B) For i in range(5):. C) For i in range(0, 5, 1):. D) For i in range(5, 0, 1):. Show Answer Correct Answer: D) For i in range(5, 0, 1):. 4. What are the dimensions of Tracy's world? A) 100 x 100. B) 200 x 200. C) 200 x 400. D) 400 x 400. Show Answer Correct Answer: D) 400 x 400. 5. Select the right syntax to create a function called my ..... function A) Def my function:. B) Define my function:. C) Func my function;. D) Create funct my function;. Show Answer Correct Answer: A) Def my function:. 6. Data that is collected and sent to a computer is A) Input. B) Output. C) Storage. D) Process. Show Answer Correct Answer: A) Input. 7. Fruit1="kiwi"fruit2="strawberry"print(len(fruit1))print(len(fruit2)) A) Kiwi and strawberry. B) 4 10. C) 4 10. D) 410. Show Answer Correct Answer: B) 4 10. 8. What is the difference between a subroutine and a function? A) They are the same thing. B) A subroutine passes values back out to the program, a function does not. C) A function passes values back out to the program, a subroutine does not. D) A function can run without being called. Show Answer Correct Answer: C) A function passes values back out to the program, a subroutine does not. 9. Display the sum of 5 + 10, using two variables:x and y A) X=y y = 10 print(x +y). B) X=5 y = x print(x +y). C) X=10 y =5 print(x +y). D) X=5 y =10 print(x +y). Show Answer Correct Answer: D) X=5 y =10 print(x +y). 10. ..... method will not only delete the item from dictionary, but also return the deleted value. A) Del ( ). B) Pop( ). C) Clear( ). D) None of the above. Show Answer Correct Answer: B) Pop( ). 11. Find the method in the following code:hero.use("door") A) Hero. B) Use(). C) Door. D) '' ". Show Answer Correct Answer: B) Use(). 12. Which of the following rules is true about locally scoped variables? A) Local variables can hold less data than global variables. B) Local variables can be seen and accessed from any part of the program code. C) Local variables will keep their same value over repeated calls to the function. D) Local variables can only be seen and used from inside a function. Show Answer Correct Answer: D) Local variables can only be seen and used from inside a function. 13. What is the output of the following code?sampleList = ["Jon", "Kelly", "Jessa"]sampleList.append(2, "Scott")print(sampleList) A) The program executed with errors. B) ['Jon', 'Scott', 'Kelly', 'Jessa']. C) ['Jon', 'Kelly', 'Scott', 'Jessa']. D) None of the above. Show Answer Correct Answer: A) The program executed with errors. 14. Which of these isn't a Python variable type? A) Integer. B) String. C) List. D) Decimal. Show Answer Correct Answer: D) Decimal. 15. X = 5y = 6print("x*y")The code above displays the following: A) 11. B) X*y. C) Syntax Error. D) 30. Show Answer Correct Answer: B) X*y. 16. Are Double or single quotes used in Python? A) Double. B) Single. C) Neither. D) Both work. Show Answer Correct Answer: D) Both work. 17. To insert an the string "Pedro" in the first position of a the nameList we use A) NameList.append("Pedro, 1"). B) NameList.insert("Pedro", 0). C) NameList.insert(1, "Pedro"). D) NameList.insert(0, "Pedro"). Show Answer Correct Answer: D) NameList.insert(0, "Pedro"). 18. The rules for correct spelling, grammar, and punctuation in a programming language A) While true loop. B) Method. C) Syntax. D) Algorithm. Show Answer Correct Answer: C) Syntax. 19. What arithmetic operations does // perform in Python? A) Remainder. B) Division. C) Floor Division. D) Modulus. Show Answer Correct Answer: C) Floor Division. 20. Which of the following will give output as [23, 2, 9, 75]?If list1=[6, 23, 3, 2, 0, 9, 8, 75] A) Print(list1[1:7:2]). B) Print(list1[0:7:2]). C) Print(list1[1:8:2]). D) Print(list1[0:8:2]). Show Answer Correct Answer: C) Print(list1[1:8:2]). 21. Given the code below, which answer best describes how many times the "while" loop body will run? answer = 0 while True:add = int(input("Enter a positive integer to add, or 0 to quit: ")) answer = answer + add if (add <= 0):break print(answer) A) None at all. B) At least once, and maybe more depending on the user's answer to the input() question. C) Exactly one time. D) An infinite number of times, because the logical expression is always True. Show Answer Correct Answer: B) At least once, and maybe more depending on the user's answer to the input() question. 22. Choose the correct way to access value 20 from the following tupleaTuple=("Orange", [10, 20, 30], (5, 15, 25)) A) ATuple[1:2][1]. B) ATuple[1:2](1). C) ATuple[1][1]. D) None of the above. Show Answer Correct Answer: C) ATuple[1][1]. 23. Which of the following is the slicing operator? A) [ ]. B) \{ \}. C) ( ). D) /. Show Answer Correct Answer: A) [ ]. 24. A line of text Python won't try to run as code. A) Boolean. B) Variable. C) Comment. D) Modulus. Show Answer Correct Answer: C) Comment. 25. Which commands would draw a pentagon A) Repeat the following five times:forward(10)turnright(72). B) Repeat the following three times:forward(10)turnright(120). C) Repeat the following four times:forward(10)turnright(90). D) Repeat the following three times:forward(10)turnright(110). Show Answer Correct Answer: A) Repeat the following five times:forward(10)turnright(72). ← PreviousNext →Related QuizzesClass 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 1Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 2Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 3Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 4Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 5Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 6Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 7Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 8Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 9Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 10 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books