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 14 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 14 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What is the output of the following code?listOne = [20, 40, 60, 80]listTwo = [20, 40, 60, 80]print(listOne == listTwo)print(listOne is listTwo) A) TRUETRUE. B) TRUEFALSE. C) FALSETRUE. D) None of the above. Show Answer Correct Answer: B) TRUEFALSE. 2. T=((1, 2, 3), (3, 4))what is T[1][1] A) 2. B) 3. C) 4. D) 1. Show Answer Correct Answer: C) 4. 3. MATCH THE FOLLOWING:1. concatenation A) +=2. Append B) [ ]3. String Slicing C) * 4. Repeating D) + A) 1-A, 2-B, 3-C, 4-D. B) 1-D. 2-A, 3-B, 4-C. C) 1-B. 2-A, 3-C, 4-D. D) 1-A, 2-D, 3-C, 4-B. Show Answer Correct Answer: B) 1-D. 2-A, 3-B, 4-C. 4. What is the output of the following code?for i in range(1, 6, 2):print(i) A) 1357. B) 1234. C) 12345. D) 135. Show Answer Correct Answer: D) 135. 5. What would be printed by the commandprint('12-5') A) '7'. B) 7. C) 12-5. D) '12-5'. Show Answer Correct Answer: B) 7. 6. If we needed to store information such as a POSTCODE in PYTHON, what data type would we use? A) String (alphanumerical). B) Float (decimal point). C) Boolean (true or false). D) None of the above. Show Answer Correct Answer: A) String (alphanumerical). 7. Identify the first statement that creates a class named Employee. A) Class Employee():. B) Class Employee:. C) Class Employee:. D) Class employee:. Show Answer Correct Answer: B) Class Employee:. 8. A="god help those who help themselves""help" in "a" A) False. B) Wrong out put. C) Error. D) True. Show Answer Correct Answer: D) True. 9. The number of lines drawn in each case, assuming that the turtle module has been imported:Case 1:for i in range(0, 10):turtle.forward(100)turtle.left(90)Case 2:for i in range(1, 10):turtle.forward(100)turtle.left(90) A) 10, 9. B) 10, 10. C) 9, 10. D) 9, 9. Show Answer Correct Answer: A) 10, 9. 10. If a function named "mystery" is defined as taking no parameters, how would you call that function from your code? A) Mystery[]. B) Mystery. C) #mystery. D) Mystery(). Show Answer Correct Answer: D) Mystery(). 11. What is the order of precedence in python?$^{i) Parentheses}$$^{ii) Exponential}$$^{iii) Multiplication}$$^{iv) Division}$$^{v) Addition}$$^{vi) Subtraction}$ A) I, ii, iii, iv, v, vi. B) Ii, i, v, iii, v, vi. C) I, ii, iii, iv, v, vi. D) I, ii, iii, iv, v, vi. Show Answer Correct Answer: A) I, ii, iii, iv, v, vi. 12. In programming, lists are often known as ..... A) Elements. B) Indexes. C) Arrays. D) Data. Show Answer Correct Answer: C) Arrays. 13. Who manages the development of Python? A) Python Software Foundation (PSF). B) Python Development Team. C) Guido van Rossum. D) Python Community. Show Answer Correct Answer: A) Python Software Foundation (PSF). 14. Look at the following code:age = 23age = float(age)What does the float() function do to the data inside age? A) Changes the string to an int. B) Does nothing. C) Changes the int to a string. D) Adds a decimal point (23.0). Show Answer Correct Answer: D) Adds a decimal point (23.0). 15. A FOR loop is ..... A) A COUNT controlled loop. B) A CONDITION controlled loop. C) All the above. D) None of the above. Show Answer Correct Answer: A) A COUNT controlled loop. 16. What would be printed to the screen?x, y, z = "Orange", "Banana", "Cherry"print(z) A) Cherry. B) Orange, Banana, Cherry. C) Orange. D) Banana. Show Answer Correct Answer: A) Cherry. 17. A data type consisting of positive and negative whole numbers A) Boolean. B) Integer. C) String. D) Float. Show Answer Correct Answer: B) Integer. 18. Choose the correct data type:0.25 A) Integer. B) Character. C) Boolean. D) Real/Float. E) String. Show Answer Correct Answer: D) Real/Float. 19. You write a program where the user types how many apples they want to buy. The program calculates the total cost and displays it on the screen in pounds. What is the output? A) TotalPrice (float). B) TotalPrice = numberOfApples*25/100. C) TotalPrice = numberOfApples. D) NumberOfApples (integer). Show Answer Correct Answer: A) TotalPrice (float). 20. Choose the correct data type:Height (in metres) Example:1.64 A) Real/Float. B) Integer. C) Character. D) Boolean. E) String. Show Answer Correct Answer: B) Integer. 21. ..... data type contain a set of characters (text) or word such as Hello, Ali, Car Type etc. A) Int. B) String. C) Char. D) Float. Show Answer Correct Answer: B) String. 22. Python correct naming convention for variables is? A) NEWUSER25. B) New user25. C) 25NewUser. D) 25 new user. E) NewUser25. Show Answer Correct Answer: B) New user25. 23. What is the purpose of the else statement in a for loop? A) To specify a block of code to be executed before the loop starts. B) To specify a block of code to be executed if the loop completes normally. C) To specify a block of code to be executed if the loop does not complete normally. D) To specify a block of code to be executed after each iteration of the loop. Show Answer Correct Answer: B) To specify a block of code to be executed if the loop completes normally. 24. True or False:There are no symbols which can be used in a variable name. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 25. Numbers = [1, 3, 5, 7]Which of the following code inserts 9 into the list above at index 2 A) Numbers.insert(2, 9). B) Numbers.insert(1, 9). C) Numbers.insert(3, 9). D) None of the above. Show Answer Correct Answer: A) Numbers.insert(2, 9). 26. Str="computer"print(str[-6:-1]) A) Mpute. B) Mputr. C) Ompute. D) Mputer. Show Answer Correct Answer: A) Mpute. 27. How do you write a program in Python? A) Using Powerpoint. B) Using Excel. C) Using Word. D) Using IDLE. Show Answer Correct Answer: D) Using IDLE. 28. A straight line from the center to the circumference of a circle or sphere is the A) Chord. B) Radius. C) Diameter. D) Pi. Show Answer Correct Answer: B) Radius. 29. What is the keyword needed to repeat code (iterate) in Python? A) Print. B) Input. C) If. D) For. Show Answer Correct Answer: D) For. 30. My ..... name = "Awesome"My ..... name in this string is ..... A) A variable. B) Syntax. C) Prompt. D) My name. Show Answer Correct Answer: A) A variable. 31. How do i remove something from a list? A) Variable=(new variable). B) Variable.append(). C) Variable.remove(). D) Variable.delete(). Show Answer Correct Answer: C) Variable.remove(). 32. People = ["John", "Rob", "Bob"]print (people[4]) what would this result be? A) Bob. B) Error. C) Rob. D) John. Show Answer Correct Answer: B) Error. 33. Python is the fastest growing programming language: A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 34. Choose the correct data type:"£" A) String. B) Real/Float. C) Boolean. D) Integer. E) Character. Show Answer Correct Answer: E) Character. 35. What is the name of the built-in command in python to output data? A) Print. B) Input. C) Display. D) Print. Show Answer Correct Answer: A) Print. 36. Is python an interpreter or compiler programming language? A) Compiler. B) Interpreter. C) All the above. D) None of the above. Show Answer Correct Answer: B) Interpreter. 37. Which of the following best describes where you should define your function in your code? A) Near the bottom of the source file, after that function is called by any main program code. B) Always place functions in a separate source file. C) Near the top of the source file, before that function is called by any main program code. D) The location is not important, so place the function wherever you like. Show Answer Correct Answer: C) Near the top of the source file, before that function is called by any main program code. 38. Please select all correct way delete the following dictionarystudent = { "name": "Emma", "class":9, "marks":75 } A) Del student. B) Student.clear(). C) Student.remove(). D) Del student[0:2]. Show Answer Correct Answer: A) Del student. 39. Which of the following sequences would be generated by the given line of code?range (10, 0, -5) A) 10, 5. B) 10, 5, 0. C) 0, 5, 10. D) 10, 9, 8, 7, 6, 5. Show Answer Correct Answer: A) 10, 5. 40. Extension of Python A) Py. B) .PYS. C) .PYE. D) .py. Show Answer Correct Answer: D) .py. 41. You have the following dictionary definition:d = {'foo':100, 'bar':200, 'baz':300}What method call will delete the entry whose value is 200? A) Delete d('bar'). B) D.pop("bar"). C) D.remove("bar"). D) None of the above. Show Answer Correct Answer: B) D.pop("bar"). 42. What does the following code do? myAge = int(myAge) A) Converts the variable myAge from a integer to a string. B) Missing input. C) Syntax Error. D) Converts the variable myAge to a integer. Show Answer Correct Answer: D) Converts the variable myAge to a integer. 43. Which function truncates the fractional part of given number and returns only the integer or whole part. A) Hex(). B) Int(). C) Oct(). D) Round(). Show Answer Correct Answer: B) Int(). 44. What is the correct definition for 'pseudo code?' A) A notation resembling a complex programming language, used in program design. B) A notation resembling a simplified programming language, used in program design. C) All the above. D) None of the above. Show Answer Correct Answer: B) A notation resembling a simplified programming language, used in program design. 45. Grades = [2.0, 3.0, 4.0]How do you get the length of the list above A) List.length(grades). B) Len(grades). C) Length(grades). D) List.len(grades). Show Answer Correct Answer: B) Len(grades). 46. A = ['foo', 'bar', 'baz', 'qux', 'quux', 'corge']Which display correct output from below? A) Print(a[-5:-3])['bar', 'baz']. B) Print(a[4::-1])['quux', 'baz', 'foo']. C) None. D) Print(a[2])['bar']. Show Answer Correct Answer: A) Print(a[-5:-3])['bar', 'baz']. 47. Mr. Whiting is 45 years old. This is an example of: A) Processing. B) Input. C) Output. D) Storage. Show Answer Correct Answer: C) Output. 48. Which two statements are used to implement iteration/Repetition)? A) IF and WHILE. B) ELSE and WHILE. C) FOR and WHILE. D) IF and ELSE. Show Answer Correct Answer: C) FOR and WHILE. 49. How do you access the first element of a list in Python? A) List name[first]. B) List name[1]. C) List name[-1]. D) List name[0]. Show Answer Correct Answer: D) List name[0]. 50. How will the following code look on the screen?print ("I love programming.") print ("I love programming.") A) I LOVE PROGRAMMINGI LOVE PROGRAMMING. B) I love programming.I love programming. C) "I love programming.""I love programming.". D) I love programming. I love programming. Show Answer Correct Answer: B) I love programming.I love programming. 51. Str1='101'x=int(str1)z=x+400print(z) A) 101400. B) X400. C) 501. D) None of above. Show Answer Correct Answer: C) 501. 52. In the following code, what value will be assigned to the variable "cat" ?mouse + cat + dog = "small" + "medium" + "large" A) Small, medium, large. B) Small. C) Medium. D) Large. E) Nothing, that operation will throw an error. Show Answer Correct Answer: E) Nothing, that operation will throw an error. 53. What is displayed to the screen when the following code runs? esports = ["Donkey Kong", "Galaga", "Pac Man"] esports.insert(0, "Centipede") print(esports) A) ['Centipede', 'Centipede', 'Centipede']. B) ['Centipede', 'Donkey Kong', 'Galaga', 'Pac Man']. C) ['Centipede', 'Galaga', 'Pac Man']. D) ['Donkey Kong', 'Galaga', 'Pac Man', 'Centipede']. Show Answer Correct Answer: B) ['Centipede', 'Donkey Kong', 'Galaga', 'Pac Man']. 54. What is the output of the following code?Time = "Day" Sleepy = False Pajamas = "Off" if Time == "Night" and Sleepy == True:Pajamas = "On" print(Pajamas) A) Day. B) On. C) False. D) Off. Show Answer Correct Answer: D) Off. 55. Variable names can start with ..... A) Only capital letters. B) Any letter or an underscore ( ). C) Any number, letter or an underscore ( ). D) Any letter or symbol. Show Answer Correct Answer: B) Any letter or an underscore ( ). 56. Which data type is used to store whole numbers in Python? A) Str. B) Float. C) Bool. D) Int. Show Answer Correct Answer: D) Int. 57. ..... function can be used to insert an element/object at a specified index. A) Extend( ). B) Insert ( ). C) Append( ). D) None of the above. Show Answer Correct Answer: B) Insert ( ). 58. ..... is a data type that contains a single character such as A, a, Z, z etc. A) Int. B) Char. C) String. D) Float. Show Answer Correct Answer: B) Char. 59. What is an example of a boolean? A) 46.7. B) 56. C) True/False. D) "Hello!". Show Answer Correct Answer: C) True/False. 60. What is the output of the code shown below?g = (i for i in range(5))type(g) A) Class <'loop'>. B) Class <'generator'>. C) Class <'range'>. D) Class <'iteration'>. Show Answer Correct Answer: B) Class <'generator'>. ← 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