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 6 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 6 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Which of the following is NOT a reason that loops are useful when writing code? A) Loops let us make shapes of multiple sizes. B) Loops make it easier to alter code once it's written. C) Loops make our code easier to read. D) Loops help us write the same program with less lines of code. Show Answer Correct Answer: A) Loops let us make shapes of multiple sizes. 2. The code you use to receive and input from the keyboard A) Enter(). B) Receive(). C) Add(). D) Input(). Show Answer Correct Answer: D) Input(). 3. Which of the following statement is true between char and string data types? A) Char data type contain only a character but string data type contain more than one characters. B) Char and string data type can use only one character. C) Char and string is not valid data type. D) Char and string can only be used with number values only. Show Answer Correct Answer: A) Char data type contain only a character but string data type contain more than one characters. 4. What is the correct order of the following? A) If elif else elif. B) Ifelifelse. C) Elseif. D) If else elif. Show Answer Correct Answer: B) Ifelifelse. 5. If L1=[2, 4, 8, 16] What is the result of the following statement16 in L1 A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 6. If function definition has no content, then what statement to be used to avoid getting an error. A) Nostatement. B) Empty. C) Pass. D) Blank. Show Answer Correct Answer: C) Pass. 7. Which one is not true about function? A) It breaks the large program into small modules. B) It avoids repetition. C) It makes code reusable. D) It makes the program unorganized. Show Answer Correct Answer: D) It makes the program unorganized. 8. "def" keyword is used in python to- A) Define a new function. B) Define a new conditional variable. C) Def is a variable. D) Use conditional. Show Answer Correct Answer: A) Define a new function. 9. Which of the following correctly stores 'price' as a decimal number? A) Price = str( input ("Price: "). B) Price = float ( input ("Price: "). C) Price = input ("Price: "). D) Price = int ( input ("Price: "). Show Answer Correct Answer: B) Price = float ( input ("Price: "). 10. What key word describesThe process of defining the 'type' of a piece of data? A) Variable. B) Operator. C) Sequence. D) Casting. Show Answer Correct Answer: D) Casting. 11. Which kind of loop would be used?I need a program that will keep letting me add a monthly payment for 12 months. A) FOR Loop. B) WHILE Loop. C) All the above. D) None of the above. Show Answer Correct Answer: A) FOR Loop. 12. Kind of loop used when you know the number of times you want it to repeat A) For. B) While. C) List. D) If. Show Answer Correct Answer: A) For. 13. Suppose list1 is [1, 5, 9], what is sum(list1)? A) 1. B) 9. C) 15. D) None. Show Answer Correct Answer: C) 15. 14. What is the output of the following code?str = "pynative"print (str[1:3]) A) Py. B) Yna. C) Yn. D) Pyn. Show Answer Correct Answer: C) Yn. 15. How do i remove something from the end of a list? A) Variable=variable-end. B) Variable.delete(). C) Variable.remove(). D) Variable.pop(). Show Answer Correct Answer: D) Variable.pop(). 16. What brackets are used to create a list? A) (). B) []. C) All the above. D) None of the above. Show Answer Correct Answer: B) []. 17. Choose the correct data type:Attendance of a studentExample:yesExample 2:no A) Boolean. B) String. C) Real/Float. D) Integer. E) Character. Show Answer Correct Answer: D) Integer. 18. Which of the following symbols is used in the beginning of a line to create a single line comment in Python? A) #. B) *. C) @. D) &&. Show Answer Correct Answer: A) #. 19. What is the result of following Program in python3for i in range(1, 4):print(i)if(i==2):continue; A) 123. B) Error. C) 1. D) 13. Show Answer Correct Answer: C) 1. 20. In Python script editor, the errors will be shown in ..... color in the IDLE window? A) Orange. B) Black. C) Green. D) Red. Show Answer Correct Answer: D) Red. 21. A Python dictionary stores ..... A) Value-key pairs. B) Key-value pairs. C) All the above. D) None of the above. Show Answer Correct Answer: B) Key-value pairs. 22. How do Burmese Pythons affect the food chain in the Everglades? A) By introducing new species into the ecosystem. B) By building nests that provide habitats for other animals. C) By preying on top predators like alligators. D) By pollinating native plants. Show Answer Correct Answer: C) By preying on top predators like alligators. 23. A # in Python means the user is trying to ..... A) Tic-tac-toe. B) Hashtag. C) Comment. D) Ratio. Show Answer Correct Answer: C) Comment. 24. Sonam has written this program in Python. One of the lines contains at least one error. Which line is it? A) Name=input('please enter your name'). B) Print(happy to meet you). C) Print('you have great name'). D) Print( "Hello world!" ). Show Answer Correct Answer: B) Print(happy to meet you). 25. What is the result of the following condition if:A = 30B = 21C = 71B != A or C < A A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 26. The 'in' operator is used to check if a value exists within an iterable object container such as a list. Evaluates to true if it finds a variable in the specified sequence and false otherwise. A) TRUE. B) FALSE. C) All the above. D) None of the above. Show Answer Correct Answer: A) TRUE. 27. An empty list can be declared as A) FruitList == []. B) FruitList = ["empty"]. C) FruitList = []. D) FruitList = "". Show Answer Correct Answer: C) FruitList = []. 28. Consider the code:a=21; b=6print(a/b); print(a//b); print(a%b) What is the result? A) 3.033. B) 333. C) 3.533. D) 3.53.53. Show Answer Correct Answer: C) 3.533. 29. Comparison Operators:Select the correct operator for equals to A) ==. B) ====. C) =. D) ===. Show Answer Correct Answer: A) ==. 30. What is the output of the following piece of code?class A:def ..... init ..... (self):self.multiply(15) print(self.i) def multiply(self, i):self.i = 4 * i;class B(A):def ..... init ..... (self):super() ..... init ..... () def multiply(self, i):self.i = 2 * i;obj = B() A) An exception is thrown. B) 30. C) 60. D) 15. Show Answer Correct Answer: B) 30. 31. While True: ..... breakWhat does a break statement do inside the "While-True" loop A) The break statement breaks the code creating an error. B) It breaks the loop, else the loop will run infinitely. C) Break is just a template code and needs to be removed to execute the actual programs. D) The break statement doesn't affect the code and can be ignored in this case. Show Answer Correct Answer: B) It breaks the loop, else the loop will run infinitely. 32. What is the output of the following code?p, q, r = 10, 20, 30print(p, q, r) A) 10 20. B) 10 20 30. C) Error:invalid syntax. D) None of the above. Show Answer Correct Answer: B) 10 20 30. 33. Names = ["Hyderabad", "New Delhi", "New York"]What gets printed when you saynames[1][-1] A) K. B) Y. C) D. D) I. Show Answer Correct Answer: D) I. 34. An exception can be manually triggered by the command A) Try. B) Trigger. C) Except. D) Raise. Show Answer Correct Answer: D) Raise. 35. What is elif in Python? A) Else if. B) Eliminate if. C) False. D) A person's name. Show Answer Correct Answer: A) Else if. 36. What is a Count-Controlled loop? A) For loop. B) While loop. C) All the above. D) None of the above. Show Answer Correct Answer: A) For loop. 37. Mylist = ["a", "b"]mylist[1] = "c"'print(mylist) A) ["a", "b", "c"]. B) ["a", "c"]. C) ["a", "b"]. D) Mylist. Show Answer Correct Answer: B) ["a", "c"]. 38. What is the output of program below?mariana ..... islands = ['Saipan', 'Tinian', 'Rota']mariana ..... islands.append('Guam')print(mariana ..... islands) A) ['Saipan', 'Tinian', 'Rota', 'Guam']. B) ['Saipan', 'Tinian', 'Rota']. C) ['Guam', 'Saipan', 'Tinian', 'Rota']. D) ['Guam', 'Tinian', 'Rota']. Show Answer Correct Answer: A) ['Saipan', 'Tinian', 'Rota', 'Guam']. 39. Which of the following would be an example of a float variable: A) GuessCount = 100. B) ValidInput = False. C) Name = "Bilbo". D) Pi = 3.14159265359. Show Answer Correct Answer: D) Pi = 3.14159265359. 40. What is one of the ecological impacts of Burmese Pythons in Florida? A) They compete with humans for resources. B) They reduce populations of native species. C) They have no significant impact on the ecosystem. D) They increase the number of certain native species. Show Answer Correct Answer: B) They reduce populations of native species. 41. What is the output when we execute list( "hello" )? A) ['olleh']. B) ['hello']. C) ['llo']. D) ['h', 'e', 'l', 'l', 'o']. Show Answer Correct Answer: D) ['h', 'e', 'l', 'l', 'o']. 42. A loop that repeats forever until the level is beaten A) Infinite loop/while true loop. B) While loop. C) Loop. D) Forever loop. Show Answer Correct Answer: A) Infinite loop/while true loop. 43. Which is NOT a data type in Python? A) Boolean. B) Anchor. C) Integer. D) Float. Show Answer Correct Answer: B) Anchor. 44. In Python, Dictionaries are A) Immutable. B) Mutable. C) All the above. D) None of the above. Show Answer Correct Answer: B) Mutable. 45. Look at the following code:L = 50W = 30Area = L * Wprint ("Area")What is the result of this code? A) An error message. B) Area. C) 50. D) 150. Show Answer Correct Answer: B) Area. 46. If I want to store my name in a variable, which of the following would be a good variable name in best practice? A) Mister. B) Abcdef. C) Name. D) Teacher. Show Answer Correct Answer: C) Name. 47. What concept repeats whatever is inside it? A) Loop. B) Variable. C) Function. D) Conditional. Show Answer Correct Answer: A) Loop. 48. Str="world of python programming"print(str[0:5]) A) Wolrd. B) World. C) Word. D) Wold. Show Answer Correct Answer: B) World. 49. In python the ' BOOLEAN data type' can be defined as ..... ? A) Holds a number with a decimal point. B) Holds alphanumerical data. C) Holds either true or false. D) Holds whole numbers. Show Answer Correct Answer: C) Holds either true or false. 50. Any statements inside an IF clause (section) can be executed multiple times. A) FALSE. B) TRUE. C) All the above. D) None of the above. Show Answer Correct Answer: A) FALSE. 51. Repeat a block of code while a certain condition is true (they do not go on forever). A) Infinite loop. B) Syntax. C) While loop. D) Loop. Show Answer Correct Answer: C) While loop. 52. If foo is equal to 'bar', what is the value of foo after this operation?foo += 3 A) Nothing, that operation will throw an error. B) Bar3. C) 3bar. D) None of the above. Show Answer Correct Answer: A) Nothing, that operation will throw an error. 53. Which of the following allow to name the various parts of a multi-item object? A) Tuples. B) Quadrats. C) Lists. D) Classes. Show Answer Correct Answer: D) Classes. 54. ..... data type represent one of two values either True or False such as 1, 0, 2 > 1, 3 < 2. A) Int. B) Char. C) Float. D) Boolean. Show Answer Correct Answer: D) Boolean. 55. What is the output of the following code:print 5//2 A) 0. B) Error. C) 2. D) 2.5. Show Answer Correct Answer: C) 2. 56. In Python, a variable needs to A) Have % symbols on either side. B) Be stated before "print". C) Start with a lower case letter. D) Variable????? We don't need variables!!!!. Show Answer Correct Answer: C) Start with a lower case letter. 57. What is displayed on the screen when the following code runs? esports = ["Donkey Kong", "Galaga", "Pac Man"] if ("Galaga" in esports):print("Found it") else:print("Not here") A) Both "Found it" and "Not here". B) Not here. C) Nothing-there is no output at all. D) Found it. Show Answer Correct Answer: D) Found it. 58. What data type represents characters? A) Boolean. B) Float. C) String. D) Int. Show Answer Correct Answer: C) String. 59. Which of the following assign the value 50 to a variable x? A) X=50. B) Let x=50. C) X<<50. D) X;=50. Show Answer Correct Answer: A) X=50. 60. What are the lines of code called in a program? A) Code. B) Lines of Code. C) Instructions. D) Source Lines of Code. Show Answer Correct Answer: D) Source Lines of Code. ← 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 7Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 8Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 9 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books