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 7 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 7 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Which of the following statements is correct for variable names in Python language? A) All variable names must begin with an underscore. B) Unlimited length. C) The variable name length is a maximum of 2. D) All of the above. Show Answer Correct Answer: B) Unlimited length. 2. What will be the output from the following code?print(17%5) A) 12. B) 3.4. C) 3. D) 2. Show Answer Correct Answer: D) 2. 3. If list=[17, 23, 41, 10] then list.append(32) will result A) [10, 17, 23, 32, 41]. B) [17, 23, 41, 10, 32]. C) [32, 17, 23, 41, 10]. D) [41, 32, 23, 17, 10]. Show Answer Correct Answer: B) [17, 23, 41, 10, 32]. 4. Dictionary keys must be ..... A) Immutable. B) Mutable. C) All the above. D) None of the above. Show Answer Correct Answer: A) Immutable. 5. List items are indexed, the first item has index [1], the second item has index [2] etc. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 6. A sequence of immutable objects is called A) Tuple. B) List. C) Derived data. D) Built in. Show Answer Correct Answer: A) Tuple. 7. What is the maximum possible length of an identifier? A) 31 characters. B) 63 characters. C) 79 characters. D) None of the mentioned. Show Answer Correct Answer: D) None of the mentioned. 8. Which of these commands would successfully create a turtle named Alice A) Alice = Turtle.pen(). B) Alice = turtle.pen(). C) Alice = Turtle.Pen(). D) Alice = turtle.Pen(). Show Answer Correct Answer: D) Alice = turtle.Pen(). 9. When you compare two values, the expression is evaluated and Python returns the Boolean answer. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 10. What can we use to get the characters from index 2 to index 4 (llo) in txt = "Hello, World" A) X= txt[1:4]. B) X= txt[2:5]. C) X= txt[2:6]. D) Optionsx= txt[2:4]. Show Answer Correct Answer: B) X= txt[2:5]. 11. When we create a program to extract each alphabet from a given string, what is it known as? A) Terminate. B) Traverse. C) Transpose. D) Translate. Show Answer Correct Answer: B) Traverse. 12. The command which helps us to reset the pen (turtle): A) Turtle.penreset(). B) Turtle.reset(). C) Turtle.penreset. D) Turtle.reset. Show Answer Correct Answer: B) Turtle.reset(). 13. Which of the following will delete key-value pair for key, "Name" from a dictionary stud? A) Stud.del["Name"]. B) Del stud["Name"]. C) Delete stud("Name"). D) None of the above. Show Answer Correct Answer: B) Del stud["Name"]. 14. What is the extension on a Python file name? A) .docx. B) .xsl. C) .py. D) .ppt. Show Answer Correct Answer: C) .py. 15. In python the Division sign is ..... A) [. B) %. C) /. D) (. Show Answer Correct Answer: C) /. 16. You are asked to write a program where the user types in the amount of marks they got for a paper with 70 marks. The program then calculates and displays their score as a percentage. What is the process? A) Marks (integer). B) Percentage = marks/70*100. C) Percentage (float). D) Percentage = marks/100*70. Show Answer Correct Answer: B) Percentage = marks/70*100. 17. True or False:5.0 is an example of the 'float' datatype. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 18. What is the output for the provided code?print(type(15 == 14)) A) Boolean. B) . C) False. D) Error:Data Type. Show Answer Correct Answer: B) . 19. Python is a general purpose programming language created by A) James Gosling. B) Bjarne Stroustrup. C) Guido Van Rossum. D) Dennis M. Ritchie. Show Answer Correct Answer: C) Guido Van Rossum. 20. If Tracy starts at the left edge of the canvas and moves forward 50 pixels, how many times will this code need to be repeated to have Tracy reach the right edge of the canvas? A) 16 times. B) 8 times. C) 12 times. D) 4 times. Show Answer Correct Answer: B) 8 times. 21. User defined Exceptions are created from the ..... Parent Class A) Exception. B) Except. C) Handler. D) User Defined Exception. Show Answer Correct Answer: A) Exception. 22. What will the following code do? name = "Bob"if name == "Bob":print ("Hello '' + name) else:print ("I dont know you") A) Prints I don't know you. B) Nothing syntax error. C) Prints bob. D) Prints Hello Bob. Show Answer Correct Answer: D) Prints Hello Bob. 23. Following set of commands are executed in shell, what will be the output? >>>str="hello">>>str[:2] A) He. B) Olleh. C) Hello. D) Lo. Show Answer Correct Answer: A) He. 24. Which is the correct way to declare and initialize a variable in Python? A) My variable:10. B) My variable == 10. C) My variable is 10. D) My variable = 10. Show Answer Correct Answer: D) My variable = 10. 25. Which of the following functions build the abstract data type? A) Constructors. B) Nested. C) Destructors. D) Recursive. Show Answer Correct Answer: A) Constructors. 26. There are 40 students in a classroom. We would like to get all students whose name starts with "A" . Which looping is suitable? A) For loop. B) While loop. C) All the above. D) None of the above. Show Answer Correct Answer: A) For loop. 27. How is a function declared in Python?* A) Declare function name():. B) Def function name():. C) Declare function function name():. D) Def function function name():. Show Answer Correct Answer: B) Def function name():. 28. Create a variable named bike and assign the value Kawasaki H2R to it A) H2R bike= "Kawasaki H2R". B) "KawasakiH2R"= bike. C) Bike= Kawasaki H2R. D) "bike" = Kawasaki. Show Answer Correct Answer: A) H2R bike= "Kawasaki H2R". 29. If you want to test more than one condition (chained condition), what do you use after if statement? A) Ifif. B) Else if. C) Elif. D) Else. Show Answer Correct Answer: C) Elif. 30. All lines in a while loop must be indented this number of spaces to be included in the loop A) 5. B) 4. C) 6. D) 3. Show Answer Correct Answer: B) 4. 31. Python Moduleto be used while implementing DICE game. A) Math. B) Cmath. C) Random. D) Numpy. Show Answer Correct Answer: C) Random. 32. Choose the correct data type:10500 A) Integer. B) String. C) Real/Float. D) Boolean. E) Character. Show Answer Correct Answer: A) Integer. 33. What, if anything, is wrong with the following?input("Type your password: ") A) There is no variable. B) Input commands don't need ( ). C) Input commands don't need '' ''. D) Nothing is wrong. Show Answer Correct Answer: A) There is no variable. 34. Which of the following is a Python command word used to indicate we want to set up a fixed loop A) While. B) For. C) Next. D) Print. Show Answer Correct Answer: B) For. 35. Which of the following would be an example of a string variable: A) Name = "Bilbo". B) GuessCount = 100. C) ValidInput = False. D) Pi = 3.14159265359. Show Answer Correct Answer: A) Name = "Bilbo". 36. Look at the following code:age = input ("What is your age? ")age = int(age + 1)print (age)If the user inputs 23, what is the result of the code? A) 24. B) 23. C) An error message. D) Age. Show Answer Correct Answer: C) An error message. 37. Which symbol should you use to assign a value to a variable? A) +. B) =. C) %. D) /. Show Answer Correct Answer: B) =. 38. What will the be the output of the following code?if (10<0) and (0 <-10):print( "A" )else:print( "B" ) A) AB. B) B. C) A. D) BA. Show Answer Correct Answer: B) B. 39. Below are the valid data types in Python EXCEPT A) Char. B) Decimel. C) Int. D) Float. Show Answer Correct Answer: B) Decimel. 40. A step-by-step process, or a defined list of steps required to accomplish a goal A) Module. B) String. C) Algorithm. D) Variable. Show Answer Correct Answer: C) Algorithm. 41. How many keywords are there in python 3.7? A) 33. B) 32. C) 30. D) 31. Show Answer Correct Answer: A) 33. 42. What 'object' do you control in Python turtle? A) The pen object which draws your commands. B) The shape object which draws your commands. C) The pencil object which draws your commands. D) The turtle object which draws your commands. Show Answer Correct Answer: D) The turtle object which draws your commands. 43. What would you put in an if statement to see if two values are equal? A) ++. B) ||. C) //. D) ==. Show Answer Correct Answer: D) ==. 44. Numbers = [5, 14, 9, 17]for number in numbers:if number % 3 == 0:print(number)The output will be? A) 14917. B) 9. C) 17. D) 1417. Show Answer Correct Answer: B) 9. 45. A straight line passing from side to side through the center of a body or figure, especially a circle or sphere, defines A) Radius. B) Pixel. C) Ulna. D) Diameter. Show Answer Correct Answer: D) Diameter. 46. To fill a shape with the colour red, which command is correct? A) Turtle.fillcolor("Red"). B) Turtle.fillcolour('Red'). C) Turtle.fillcolour("Red"). D) Turtle.fillcolor('Red'). Show Answer Correct Answer: D) Turtle.fillcolor('Red'). 47. Select the correct operator for multiplication: A) X. B) +. C) *. D) **. Show Answer Correct Answer: C) *. 48. Choose the correct data type:"initial of a first name" A) Boolean. B) Character. C) Integer. D) String. E) Real/Float. Show Answer Correct Answer: B) Character. 49. List items are ordered, changeable, and allow duplicate values. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 50. Which of the following is used in Python to give a value to a variable A) :=. B) ==. C) =. D) None of the above. Show Answer Correct Answer: C) =. 51. Which of the following function is used to count the number of elements in a list? A) Count( ). B) Index( ). C) Len( ). D) Find( ). Show Answer Correct Answer: C) Len( ). 52. In python, "Hello World" is the same as 'Hello World' A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 53. What is the result of the following code?print(bool(0)) A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 54. . Which of the following definitions for the "haunted" function will correctly set the default value for the "surprise" parameter equal to the number 1? A) Def haunted(fear, surprise "1"). B) Def haunted[fear, surprise=1]. C) Haunted(fear, surprise) = 1. D) Def haunted(fear, surprise=1):. Show Answer Correct Answer: D) Def haunted(fear, surprise=1):. 55. Find the object in the following code:helper.build("upArrow") A) Build(). B) Hero. C) Helper. D) UpArrow. Show Answer Correct Answer: C) Helper. 56. Computer programs can store information like the user's progress in a videogame with ..... A) Conditionals. B) Variables. C) Adaptors. D) A keyboard. Show Answer Correct Answer: B) Variables. 57. A = Trueb = Falsec = Falseif a or b and c:print ("GEEKSFORGEEKS")else:print ("geeksforgeeks")What will be the output? A) Geeksforgeeks. B) GEEKSFORGEEKSgeeksforgeeks. C) GEEKSFORGEEKS. D) Run time error (Multiple operators in a single if statement). Show Answer Correct Answer: C) GEEKSFORGEEKS. 58. What data type represents only two possible outcomes? A) String. B) Float. C) Int. D) Boolean. Show Answer Correct Answer: D) Boolean. 59. Numbers = [1, 2, 3, 4, 5]Which of the following code changes the element 4 to 9 A) Numbers[3] = 9. B) Numbers[4] = 9. C) All the above. D) None of the above. Show Answer Correct Answer: A) Numbers[3] = 9. 60. Select the correct operator for division: A) /. B) . C) !. D) ''. Show Answer Correct Answer: A) /. ← 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 8Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 9 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books