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 12 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 12 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. The spelling and grammar rules of a programming language is called A) GSP. B) Code. C) Syntax. D) Comments. Show Answer Correct Answer: C) Syntax. 2. What is the result of [1, 2, 3] + [4, 5, 6] in Python? A) [1, 2, 3, 9, 10, 11]. B) [5, 7, 9, 11]. C) [1, 2, 3, 4, 5]. D) [1, 2, 3, 4, 5, 6]. Show Answer Correct Answer: D) [1, 2, 3, 4, 5, 6]. 3. Which function is used to accept input from the user during the runtime. A) Help(). B) Type(). C) Input(). D) Print(). Show Answer Correct Answer: C) Input(). 4. Numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]numbers [-3]What is numbers [-3] A) 8. B) 9. C) 7. D) None of the above. Show Answer Correct Answer: A) 8. 5. What is the output of this code?click = TrueLike = 0 if click:Like = Like + 1 print(Like) A) 2. B) 3. C) 0. D) 1. Show Answer Correct Answer: D) 1. 6. A set of instructions that is repeated until a condition is reached is A) An expression. B) A loop. C) Code. D) A function. Show Answer Correct Answer: B) A loop. 7. Stores True or False A) INTEGER. B) BOOLEAN. C) REAL (Float). D) STRING. Show Answer Correct Answer: B) BOOLEAN. 8. In Python, 'Hello', is the same as "Hello" A) True. B) False. C) Cant say. D) Both are wrong. Show Answer Correct Answer: A) True. 9. Slicing string X="BOnVoyage" print X[0:5] A) Oyage. B) BOnVo. C) Bonvo. D) BOnVoy. Show Answer Correct Answer: B) BOnVo. 10. What does "t '' make? A) Goes to next line. B) Horizontal space between two strings. C) Give a title. D) Add a slash. Show Answer Correct Answer: B) Horizontal space between two strings. 11. Which of the following is not a valid namespace? A) Local namespace. B) Built-in namespace. C) Global namespace. D) Public namespace. Show Answer Correct Answer: D) Public namespace. 12. To remove string "hello" from list1, we use which command? A) List.remove(hello). B) List1.remove(hello). C) List.remove( "hello" ). D) List1.remove( "hello" ). Show Answer Correct Answer: D) List1.remove( "hello" ). 13. Which is true about booleans? A) They state your age. B) It is a mixture of cool and beans. C) It sounds funny. D) They hold true and false values. Show Answer Correct Answer: D) They hold true and false values. 14. How did the pet trade contribute to the python problem? A) By selling pythons that were too large for most owners to handle. B) By breeding pythons for release into the wild. C) By smuggling pythons into Florida. D) By using pythons for entertainment purposes. Show Answer Correct Answer: A) By selling pythons that were too large for most owners to handle. 15. 19 % 2 in python A) 1. B) 2. C) 9. D) None of these. Show Answer Correct Answer: A) 1. 16. To make the turtle move forward, which command is used? A) Turtle.forward(). B) Turtle.penup(). C) Turtle.left(). D) Turtle.backward(). Show Answer Correct Answer: A) Turtle.forward(). 17. What is the function of the code:amount = int(input("Enter a conversion into pounds:))currency = input ("press 1 for indian rupees, 2 for Chinese yuan or 0 to exit:") A) To find the total amount of currency altogether. B) To calculate and convert the exchange rates. C) All the above. D) None of the above. Show Answer Correct Answer: B) To calculate and convert the exchange rates. 18. What controls a variable's scope? A) The location where it is first initialized within your code. B) The comment you place to the right of the variable name. C) The length of your variable name. D) The capitalization you select for the letters in your function name. Show Answer Correct Answer: A) The location where it is first initialized within your code. 19. Can we use the "else" clause for loops?for example:for i in range(1, 5):print(i)else:print("this is else block statement" ) A) YES. B) NO. C) All the above. D) None of the above. Show Answer Correct Answer: A) YES. 20. If the coding steps are in the incorrect order, the computer can still execute the program. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 21. Integers are ..... and floats are ..... A) Whole numbers and exponents. B) Powers and fractions. C) Fractions and whole numbers. D) Whole numbers and decimal numbers. Show Answer Correct Answer: D) Whole numbers and decimal numbers. 22. What does the 'turtle' represent in Python? A) A drawing. B) A pen. C) A program. D) A person. Show Answer Correct Answer: B) A pen. 23. Which of the following is constructed by placing expressions within square brackets? A) Classes. B) Tuples. C) Lists. D) Quadrats. Show Answer Correct Answer: C) Lists. 24. Which of these are keyword? A) In. B) Is. C) Assert. D) All of the above. Show Answer Correct Answer: D) All of the above. 25. What type of data is:a=[(1, 1), (2, 4), (3, 9)]? A) Array of tuples. B) Invalid type. C) List of tuples. D) Tuples of lists. Show Answer Correct Answer: C) List of tuples. 26. Enemy = hero.findNearestEnemy( )in the variable enemy what is being stored? A) The nearest enemy object if present. B) It is a conditional to check if enemy is present. C) The name of the nearest enemy if present. D) Hero.findNearestEnemy( ) is a method to find the nearest enemy. Show Answer Correct Answer: C) The name of the nearest enemy if present. 27. Which commands do we need to fill a shape that we have just drawn? A) T.begin fill () and t.end fill(). B) T.begin() and t.fill(). C) T.fill () and t.fill(). D) T.begin() and t.end(). Show Answer Correct Answer: A) T.begin fill () and t.end fill(). 28. Which method will remove an element the Dictionary data type? A) .pop(). B) .discard(). C) .remove(). D) None of the above. Show Answer Correct Answer: A) .pop(). 29. How would you create a program to display "Hello World!" A) Input("Hello World!"). B) Print(Hello World!). C) Print(Hello World!. D) Print("Hello World!"). Show Answer Correct Answer: D) Print("Hello World!"). 30. For string symbol + means ..... A) Addition. B) Swapp. C) Concatenation. D) Multiplication. Show Answer Correct Answer: C) Concatenation. 31. What is the term for a list within another list in Python? A) Nested list. B) Double list. C) Sub list. D) Listception. Show Answer Correct Answer: A) Nested list. 32. If p=25, what is p**2? A) 50. B) 125. C) 600. D) 625. Show Answer Correct Answer: D) 625. 33. To solve a problem that requires the user to enter 10 numbers would use what type of iteration? A) Selection. B) While loop. C) For loop. D) Variable. Show Answer Correct Answer: C) For loop. 34. In Python, to have text stated for the user to see, we use: A) ??. B) ( ). C) '' ''. D) % %. Show Answer Correct Answer: C) '' ''. 35. ..... method adds one list at the end of another list. A) Extend( ). B) Append( ). C) Insert( ). D) None of the above. Show Answer Correct Answer: A) Extend( ). 36. How do i remove the item "juice" from a list? A) Variable.pop("juice"). B) Variable.delete("juice"). C) Variable.remove("juice"). D) Variable=variable- "juice". Show Answer Correct Answer: C) Variable.remove("juice"). 37. Look at the following code:name = input ("What is your name? ")print (name)What would be printed from the print command? A) Whatever the user wrote. B) Name. C) Andre. D) What is your name?. Show Answer Correct Answer: A) Whatever the user wrote. 38. Which of the following commands will create a list? a) list1 = list() b) list1 = []. c) list1 = list([1, 2, 3]) d) all of the mentioned A) List1 = list(). B) List1 = []. C) List1 = list([1, 2, 3]). D) All of the mentioned. Show Answer Correct Answer: D) All of the mentioned. 39. Each item in a list has an "address" or index. The first index in a Python list is what? A) A. B) 1. C) 0. D) A. Show Answer Correct Answer: C) 0. 40. NameList = ["John", "Harry", "Jesse", "John", "Marry", "Larry"]print(nameList.count("John"))What would be the output A) Error. B) 2. C) 3. D) 1. Show Answer Correct Answer: B) 2. 41. What will be the output of the following Python code?import turtlet=turtle.Pen()t.goto(300, 9)t.position() A) 9.00, 300.00. B) 9, 300. C) 300, 9. D) 300.00, 9.00. Show Answer Correct Answer: D) 300.00, 9.00. 42. Which of the following is the use of function in python? A) Functions are reusable pieces of programs. B) Functions don't provide better modularity for your application. C) You can't also create your own functions. D) All of the mentioned. Show Answer Correct Answer: A) Functions are reusable pieces of programs. 43. Which operator performs a division? A) -. B) *. C) /. D) +. Show Answer Correct Answer: C) /. 44. Random.randint(3, 8) A) 0, 1, 2, 3, 4, 5, 6, 7, 8. B) 3, 4, 5, 6, 7. C) 4, 5, 6, 7. D) 3, 4, 5, 6, 7, 8. Show Answer Correct Answer: D) 3, 4, 5, 6, 7, 8. 45. Why are local variable names beginning with an underscore discouraged? A) They are used to indicate a private variables of a class. B) They slow down execution. C) They are used to indicate global variables. D) They confuse the interpreter. Show Answer Correct Answer: A) They are used to indicate a private variables of a class. 46. Which of the operator can be used in Strings? A) +. B) *. C) Both of the above. D) None of the above. Show Answer Correct Answer: C) Both of the above. 47. Code that decides whether or not to skip a section of code. A) Conditional. B) While Loop. C) For Loop. D) Then Block. Show Answer Correct Answer: A) Conditional. 48. Numbers = [2, 4, 6, 8]for number in numbers:print("hello!") A) Hello!. B) Hello! hello! hello! hello!. C) 2 4 6 8. D) 2 hello! 4 hello! 6 hello! 8 hello!. Show Answer Correct Answer: B) Hello! hello! hello! hello!. 49. What would the output of the program be? thisList = ["square", "circle", "triangle", "octagon"]if "triangle" in thisList:print("Yes, 'triangle' is in the list") else:print("No triangle here!") A) Yes, 'triangle' is in the list. B) "No triangle here!". C) All the above. D) None of the above. Show Answer Correct Answer: A) Yes, 'triangle' is in the list. 50. Which if the values below is an integer data type? A) 1. B) 1/2. C) 1.0. D) "1". Show Answer Correct Answer: A) 1. 51. What type of loop is used when you know how many times you want to repeat something? A) A Variable. B) A WHILE Loop. C) An IF function. D) A FOR Loop. Show Answer Correct Answer: D) A FOR Loop. 52. Evaluate5 * 3 ** 2 + 3 A) 33. B) 48. C) Error. D) None of the above. Show Answer Correct Answer: B) 48. 53. What is another word for 'iteration'? A) Sequencing. B) Selection. C) Repetition. D) Variable Assignment. Show Answer Correct Answer: C) Repetition. 54. What key word definesthe laws and rules of a language? A) Algorithm. B) Interpreter. C) Cast. D) Syntax. Show Answer Correct Answer: D) Syntax. 55. A data type consisting of numbers with decimals. A) Boolean. B) Float. C) Integer. D) String. Show Answer Correct Answer: B) Float. 56. What is the correct syntax to output the type of a variable or object in Python? A) Print(typeof(x)). B) Print(type(x)). C) Print(type of (x)). D) Print(typeOf(x)). Show Answer Correct Answer: B) Print(type(x)). 57. Which command should you use to display the text to the screen? A) Print. B) Text(). C) Output(). D) Print(). Show Answer Correct Answer: A) Print. 58. Operators in python are ..... A) Numbers. B) Things that do things. C) Symbols that perform an operation. D) A way to dissect the program. Show Answer Correct Answer: C) Symbols that perform an operation. 59. Numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]Which of the following code will give the output as below[7, 8, 9, 10] A) Numbers[6:]. B) Numbers[7:10]. C) Numbers[7, 10]. D) Numbers[7-10]. Show Answer Correct Answer: A) Numbers[6:]. 60. Word = "amazing"For the given string if we run word[2:5:2] what does 2 mean in this function? A) It will pick every alternate alphabet. B) It will pick only second alphabet. C) It will pick only two alphabets. D) It will pick first two alphabets. Show Answer Correct Answer: A) It will pick every alternate alphabet. ← 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