This quiz works best with JavaScript enabled. Home > Cbse > Class 11 > Science > Computer Science > Class 11 Computer Science Chapter 9 Practical Work Python Exercises – Quiz 9 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 9 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. To increment means to A) Add 1 to the variable. B) Subtract 1 from the variable. C) Decrease the value of a variable. D) Increase the value of a variable. Show Answer Correct Answer: D) Increase the value of a variable. 2. I am 18 years old! What will the output be?:IF you are 70 or older, say "You are aged to perfection!" ELIF you are exactly 50, say "Wow, you are half a century old!" ELSE say "You are a spring chicken!" A) "You are aged to perfection". B) "Wow, you are half a century old!". C) "You are spring chicken!". D) None of the above. Show Answer Correct Answer: C) "You are spring chicken!". 3. Is the following statement True of False?Boolean variables can be used as conditions in an IF statement. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 4. Sort () function in list by default sort the values in ..... A) Ascending order. B) Decending order. C) All the above. D) None of the above. Show Answer Correct Answer: A) Ascending order. 5. Which of the following would give an error? A) List1=[]. B) List1=[]*3. C) List1=[2, 8, 7]. D) None of the above. Show Answer Correct Answer: D) None of the above. 6. What function converts the data in a variable into a 'float'? A) Flt(). B) Float(). C) Int(). D) Bool(). Show Answer Correct Answer: B) Float(). 7. Python can work in ..... mode. A) 3. B) 4. C) 1. D) 2. Show Answer Correct Answer: D) 2. 8. What is print() called in Python coding? A) Output. B) Variable. C) Function. D) String. Show Answer Correct Answer: C) Function. 9. Correct file extension for python files? A) .py. B) .pt. C) .pyt. D) .pyth. Show Answer Correct Answer: A) .py. 10. 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(5):. B) For i in range(0, 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):. 11. What are the dimensions of Tracy's world? A) 400 x 400. B) 200 x 400. C) 200 x 200. D) 100 x 100. Show Answer Correct Answer: A) 400 x 400. 12. Select the right syntax to create a function called my ..... function A) Def my function:. B) Func my function;. C) Create funct my function;. D) Define my function:. Show Answer Correct Answer: A) Def my function:. 13. Data that is collected and sent to a computer is A) Storage. B) Input. C) Process. D) Output. Show Answer Correct Answer: B) Input. 14. 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. 15. 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. 16. Display the sum of 5 + 10, using two variables:x and y A) X=5 y = x print(x +y). B) X=5 y =10 print(x +y). C) X=10 y =5 print(x +y). D) X=y y = 10 print(x +y). Show Answer Correct Answer: B) X=5 y =10 print(x +y). 17. ..... 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( ). 18. Find the method in the following code:hero.use("door") A) Use(). B) Hero. C) '' ". D) Door. Show Answer Correct Answer: A) Use(). 19. 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. 20. 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. 21. Which of these isn't a Python variable type? A) List. B) Decimal. C) Integer. D) String. Show Answer Correct Answer: B) Decimal. 22. X = 5y = 6print("x*y")The code above displays the following: A) X*y. B) 11. C) Syntax Error. D) 30. Show Answer Correct Answer: A) X*y. 23. Are Double or single quotes used in Python? A) Double. B) Single. C) Neither. D) Both work. Show Answer Correct Answer: D) Both work. 24. To insert an the string "Pedro" in the first position of a the nameList we use A) NameList.append("Pedro, 1"). B) NameList.insert(0, "Pedro"). C) NameList.insert("Pedro", 0). D) NameList.insert(1, "Pedro"). Show Answer Correct Answer: B) NameList.insert(0, "Pedro"). 25. The rules for correct spelling, grammar, and punctuation in a programming language A) While true loop. B) Algorithm. C) Method. D) Syntax. Show Answer Correct Answer: D) Syntax. 26. What arithmetic operations does // perform in Python? A) Modulus. B) Remainder. C) Division. D) Floor Division. Show Answer Correct Answer: D) Floor Division. 27. 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[0:8:2]). B) Print(list1[1:8:2]). C) Print(list1[0:7:2]). D) Print(list1[1:7:2]). Show Answer Correct Answer: B) Print(list1[1:8:2]). 28. 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. 29. 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]. 30. Which of the following is the slicing operator? A) ( ). B) { }. C) [ ]. D) /. Show Answer Correct Answer: C) [ ]. 31. A line of text Python won't try to run as code. A) Boolean. B) Modulus. C) Comment. D) Variable. Show Answer Correct Answer: C) Comment. 32. Which commands would draw a pentagon A) Repeat the following three times:forward(10)turnright(110). B) Repeat the following three times:forward(10)turnright(120). C) Repeat the following four times:forward(10)turnright(90). D) Repeat the following five times:forward(10)turnright(72). Show Answer Correct Answer: D) Repeat the following five times:forward(10)turnright(72). 33. Which of the following best describes how many times the statements in the body of a "while" loop will run? A) 0, 1 or more times depending on the logical expression of the "while" statement. B) At least once. C) A maximum of 10 times no matter what. D) An infinite number of times until a "continue" statement is reached. Show Answer Correct Answer: A) 0, 1 or more times depending on the logical expression of the "while" statement. 34. In python the ' STRING data type' can be defined as ..... ? A) Hold whole numbers. B) Holds alphanumeric text. C) Holds numbers with a decimal point. D) Holds either a true or false value. Show Answer Correct Answer: B) Holds alphanumeric text. 35. [1, 2, 8, 9] < [9, 1]What will be the result if we compare these two lists? A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 36. Each item in a list has an index. What is the first index in a Python list? A) 0. B) A. C) A. D) 1. Show Answer Correct Answer: A) 0. 37. Look at the following code:Length = 50Width = 30Area = Length * Widthprint (Area)What is the result of this code? A) An error message. B) 150. C) Area. D) 50. Show Answer Correct Answer: B) 150. 38. Which is the powerful function used for formatting strings? A) Chr( ). B) Title( ). C) Capitalize( ). D) Format( ). Show Answer Correct Answer: D) Format( ). 39. If i want to continuously check for a correct answer, what loop would i use? A) For loop. B) While loop. C) All the above. D) None of the above. Show Answer Correct Answer: B) While loop. 40. Python functions=lower("INDIA)print(s) A) India. B) India. C) INDIA. D) INDIA. Show Answer Correct Answer: A) India. 41. Why do we learn Python? A) It's a really big snake. B) It's the name of a very funny comedy show. C) It's simple and easy to learn. D) It's so rare that no one else knows it. Show Answer Correct Answer: C) It's simple and easy to learn. 42. Say True or False:Bitwise shift operators (<<, >>) has higher precedence than Bitwise And(&) operator A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 43. True or False:You need to convert an integer to a string before you can use it in the print() function. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 44. What is the output of the following piece of code?class A:def ..... init ..... (self, x=3):self ..... x = x class B(A):def ..... init ..... (self):super() ..... init ..... (5) def display(self):print(self ..... x)def main():obj = B() obj.display()main() A) Error, class member x has two values. B) 5. C) 3. D) Error, protected class member can't be accessed in a subclass. Show Answer Correct Answer: B) 5. 45. Is the following statement true or false?More than one condition cannot be used with an IF statement. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 46. True or False:Python can be used to make games and phone apps. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 47. What is the output of the following piece of code when executed in Python shell?>>> a=("Check")*3>>> a A) ('CheckCheckCheck'). B) ('Check', 'Check', 'Check'). C) * Operator not valid for tuples. D) Syntax error. Show Answer Correct Answer: A) ('CheckCheckCheck'). 48. Which of the following pieces of code defines a list of all the numbers from 4 to 12? A) Range(4, 13). B) Range(4, 12). C) Range( 3, 12). D) Range(3, 13). Show Answer Correct Answer: A) Range(4, 13). 49. Which of the following are valid string manipulation functions in Python? A) Count(). B) Upper(). C) Strip(). D) All of the above. Show Answer Correct Answer: D) All of the above. 50. What is the output of the following code:print 10//3 A) Error. B) 3. C) 3.5. D) 1. Show Answer Correct Answer: B) 3. 51. What is missing in the square braces?cheer = "Go Eagles!"print (cheer[ ] + cheer [ ] + cheer [ ])If the output is Goggles A) 0:1 5 5:8. B) 0:1 5 5:9. C) 1:2 6 6:10. D) 0:2 5 5:9. Show Answer Correct Answer: D) 0:2 5 5:9. 52. Which type of Programming does Python support? A) Object oriented programming. B) Structured programming. C) Functional programming. D) All of the above. Show Answer Correct Answer: D) All of the above. 53. Str="world of python programming"str+=" store"str.replace('o', 'O') A) 'wOrld Of python prOgramming stOre'. B) 'wOrld Of pythOn programming stOre'. C) 'wOrld Of pythOn prOgramming store'. D) 'wOrld Of pythOn prOgramming stOre'. Show Answer Correct Answer: D) 'wOrld Of pythOn prOgramming stOre'. 54. The Boolean operator that means "not equal to" is A) . B) <>. C) XX. D) !=. Show Answer Correct Answer: D) !=. 55. What will the output be from the following code?print(9/3) A) 3. B) SyntaxError. C) 3.0. D) 9/3. Show Answer Correct Answer: C) 3.0. 56. What is the assignment operator? A) =. B) ==. C) +=. D) $\rightarrow$. Show Answer Correct Answer: A) =. 57. NameList = ["John", "Harry", "Jesse", "John", "Marry", "Larry"]del nameList[3]print(nameList)What would be the output A) Error. B) ['John', 'Harry', 'Jesse', 'John', 'Larry']. C) ['John', 'Harry', 'Jesse', 'Marry', 'Larry']. D) ['John', 'Harry', 'John', 'Marry', 'Larry']. Show Answer Correct Answer: C) ['John', 'Harry', 'Jesse', 'Marry', 'Larry']. 58. What is the term for steps you follow to solve a problem? A) Program. B) Algorithm. C) Python. D) Hack. Show Answer Correct Answer: B) Algorithm. 59. True or False:There are only 3 different programming languages A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 60. If L1=[2, 4, 8, 16], L2=[32, 64] what is L1+L2 A) [2, 4, 8, 16, 32, 64]. B) [2, 4, 8, 16][32, 64]. C) [2, 4, 8, 16], [32, 64]. D) None of the above. Show Answer Correct Answer: A) [2, 4, 8, 16, 32, 64]. ← PreviousNext →Related QuizzesScience QuizzesClass 11 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 8 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books