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 1 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 1 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What is called when a function is defined inside a class? A) Class. B) Module. C) Method. D) Function. Show Answer Correct Answer: C) Method. 2. Str="world of python programming"print(str.capitalize()) A) World of python Programming. B) World of Python Programming. C) World of Python programming. D) World of python programming. Show Answer Correct Answer: D) World of python programming. 3. L ..... names=['Harsh', 'Amit', 'Sahil', 'Viresh']min(L ..... names) A) 'Harsh'. B) 'Amit'. C) 'Viresh'. D) None of the above. Show Answer Correct Answer: B) 'Amit'. 4. A data type consisting of letters, numbers and symbols enclosed in quotation marks. A) Boolean. B) Integer. C) Float. D) String. Show Answer Correct Answer: D) String. 5. What does this symbol represent?> A) Greater than. B) Less than. C) Equal to. D) Less than or equal to. Show Answer Correct Answer: A) Greater than. 6. Arithmetic OperatorsWhat is a %? A) Multiplication. B) Increment. C) Division. D) Modulo. Show Answer Correct Answer: D) Modulo. 7. What is the result of following Program in python3a=10b=20c=a+bprint("Sum is"+c) A) Sum is 30. B) 30. C) Sum 30. D) Error. Show Answer Correct Answer: D) Error. 8. Look at the following code:name = "John"age = "23"What type of data is stored in the variable age? A) Int. B) Float. C) Str. D) Nothing. Show Answer Correct Answer: C) Str. 9. Which of these will allow me to count from 0-20 in steps of 5? A) For x in range(0, 20):print(x). B) For x in range(0, 21, 5):print(y). C) For x in range(0, 21, 5):print(x). D) While x = (0, 20, 5):print(x). Show Answer Correct Answer: C) For x in range(0, 21, 5):print(x). 10. Which of the following character is used to give single-line comments in Python? A) B) #. C) $. D) //. Show Answer Correct Answer: B) #. 11. If I declare a global variable, can I then use its value within the scope of a function? A) Yes. B) No. C) All the above. D) None of the above. Show Answer Correct Answer: A) Yes. 12. Which of the following is a compound structure? A) Pair. B) Triplet. C) Single. D) Quadrat. Show Answer Correct Answer: A) Pair. 13. Index of a string begins with A) -1. B) 0. C) A. D) 1. Show Answer Correct Answer: B) 0. 14. Comparison Operators:Select the correct operator for not equal to A) =!. B) !=. C) =!=. D) !. Show Answer Correct Answer: B) !=. 15. What character should be placed at the end of the function "def" line, after the parentheses? A) Colon(:). B) Dash (-). C) Exclamation (!). D) Hashtag (#). Show Answer Correct Answer: A) Colon(:). 16. Which of the following is an advantage of using local variables? A) They allow the variable to be used throughout the whole program. B) They allow variable identifiers to be reused each time. C) They are easier to program than global variables. D) A wider range of data types can be used. Show Answer Correct Answer: B) They allow variable identifiers to be reused each time. 17. In a Python program, what would be the increment value for the looping variable in the FOR LOOP code?for x in range (25, 10, -5) A) 5. B) 25. C) -5. D) 10. Show Answer Correct Answer: C) -5. 18. Inheritance can only be applied between one sub class and one super class. A) True. B) False. C) Occasionally. D) Depending on instantiation. Show Answer Correct Answer: B) False. 19. What is the output of this expression, 3*1**3 A) 9. B) 3. C) 27. D) 1. Show Answer Correct Answer: B) 3. 20. A WHILE 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: B) A CONDITION controlled loop. 21. Consider this list, what will be the highest index the list can have:li=[1, 2, 3, 4, 5] A) 3. B) 5. C) 4. D) 2. Show Answer Correct Answer: C) 4. 22. Items are accessed by their keys in a dictionary A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 23. Given a list with 3 items, what is the lowest and highest valid index number into that list? A) 1 and 2. B) 0 and 2. C) 0 and 3. D) 3. Show Answer Correct Answer: B) 0 and 2. 24. Which of the following is not a valid string function? A) Isalnum. B) Isspace. C) Isalphanumeric. D) Islower. Show Answer Correct Answer: C) Isalphanumeric. 25. Symbols used to store data; they represent a value that can change. A) Object. B) Loop. C) Variable. D) Algorithm. Show Answer Correct Answer: C) Variable. 26. Why do certain words change color in Python? A) To show that they are recognized as key words. B) To tell Python to skip these words when running the code. C) To show you that these words can be clicked. D) To tell you that these words cannot be used in Python code. Show Answer Correct Answer: A) To show that they are recognized as key words. 27. Text to be output to the screen should be enclosed by '' '' A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 28. Str="world of python programming"print(str[::-2]) A) Gimropnhy odrw. B) Gimopnhy odrw. C) Gimropnhy odr. D) Gimronhy odrw. Show Answer Correct Answer: A) Gimropnhy odrw. 29. The following code will stop the loop if i is 3 Fill in the blanks to perform the same i = 1 ..... i < 6:if i == 3:break i += 1 A) Do while. B) While. C) If. D) For. Show Answer Correct Answer: B) While. 30. What will be the data type of num1 if the following code is executed?num1=int('3.14') A) Float. B) String. C) Number. D) Int. Show Answer Correct Answer: D) Int. 31. Find the argument in the following code:hero.moveUp(4) A) Up(). B) MoveUp(). C) Hero. D) 4. Show Answer Correct Answer: D) 4. 32. Which version of Python introduced list comprehensions? A) Python 2.7. B) Python 4.0. C) Python 2.0. D) Python 3.5. Show Answer Correct Answer: C) Python 2.0. 33. ..... is a data type that can represent one of two values either True or False such as 1, 0, 2 > 1, 3 < 2. A) Int. B) Float. C) Boolean. D) Char. Show Answer Correct Answer: C) Boolean. 34. Which statement will check to see if a is equal to b? A) If a == b:. B) If a != b:. C) If a = b:. D) If a == b. Show Answer Correct Answer: A) If a == b:. 35. What is the output of the code?a = (33, 55)a.append(22)print(a) A) 33 55 22. B) 33, 55, 22. C) Error. D) 335522. Show Answer Correct Answer: C) Error. 36. Which one of the following has the highest precedence in the expression? A) ParenthesIs. B) Exponential. C) Multiplication. D) Addition. Show Answer Correct Answer: A) ParenthesIs. 37. What is concatenation? A) Replacing a string variable with another string variable. B) Combining two variables such as first name and last name. C) One of the food options in the canteen on Friday. D) A large collection of cats in an open space. Show Answer Correct Answer: B) Combining two variables such as first name and last name. 38. What keyword do you use to start a function? A) Def. B) Key. C) In. D) Function. Show Answer Correct Answer: A) Def. 39. What type of inheritance is illustrated in the following piece of code?class A():passclass B():passclass C(A, B):pass A) Multi-level inheritance. B) Hierarchical inheritance. C) Single-level inheritance. D) Multiple inheritance. Show Answer Correct Answer: D) Multiple inheritance. 40. The Python keywords/commands "break" and "continue" can be used in other structures (such as IF statements) as well as in loops. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 41. Which of the following symbols is used in Python to mean "Less than or equal to" ? A) !=. B) =<. C) <<. D) <=. Show Answer Correct Answer: D) <=. 42. If a function doesn't have a return statement, which of the following does the function return? A) Int. B) Null. C) None. D) An exception is thrown without the return statement. Show Answer Correct Answer: C) None. 43. A variable that is defined inside a method and belongs only to the current instance of a class is known as? A) Function overloading. B) Instantiation. C) Instance variable. D) Inheritance. Show Answer Correct Answer: C) Instance variable. 44. Why is it difficult to find pythons in the Florida swamps? A) The pythons are very fast. B) All of the above. C) The terrain is challenging to navigate. D) The pythons camouflage well. Show Answer Correct Answer: B) All of the above. 45. Leo wants to create a subroutine that will roll a dice. Which syntax is correct? A) Def dice roll ():. B) Def diceroll (). C) Def diceroll []:. D) Def diceroll ():. Show Answer Correct Answer: D) Def diceroll ():. 46. Which operator checks if a value is not equal to another value? A) !=. B) ==. C) =. D) +=. Show Answer Correct Answer: A) !=. 47. Else if (elif) is used in which situation? A) You can use if statement to replace elif. B) Else is enough for now. C) If the previous conditions were not true. D) Any situation. Show Answer Correct Answer: C) If the previous conditions were not true. 48. What is the output of the following code?var1 = 1var2 = 2var3 = "3"print(var + var2 + var3) A) 33. B) 6. C) 123. D) ERROR. Show Answer Correct Answer: D) ERROR. 49. A string is immutable in Python?Every time when we modify the string, Python Always creates a new String and assigns a new string to that variable. A) TRUE. B) FALSE. C) All the above. D) None of the above. Show Answer Correct Answer: A) TRUE. 50. Loop that runs till the condition is true A) If. B) For. C) List. D) While. Show Answer Correct Answer: D) While. 51. S="welcome"print( s. center (15, '*')) A) Undefine function center. B) ***welcome***. C) ****welcome****. D) ****welcome***. Show Answer Correct Answer: C) ****welcome****. 52. How do you identify the statements that belong to the body of a function? A) Indent those statement the same amount underneath the function "def" statement. B) Add opening and closing curly braces { and } to mark the start and stop of the function body. C) Add the "def" keyword to the beginning of each statement. D) Add the same comment (#) to the right of each statement within the body. Show Answer Correct Answer: A) Indent those statement the same amount underneath the function "def" statement. 53. What will be printed for the value 8 for num# program to check even or oddnum = (int)(input("enter any number"))if num%2 == 0:print("the number is even")else:print("the number is odd") A) Even. B) The number is even. C) The number is odd. D) None. Show Answer Correct Answer: B) The number is even. 54. When using a command to move the turtle to a specific position on the drawing canvas, the middle of the canvas is represented by which coordinates? A) 500, 500. B) 100, 100. C) 1, 1. D) 0, 0. Show Answer Correct Answer: D) 0, 0. 55. In python, comment lines start with this symbol A) &. B) %. C) //. D) #. Show Answer Correct Answer: D) #. 56. If you wanted Tracy to complete her command immediately, which speed value would you use? A) 5. B) 0. C) 1. D) 10. Show Answer Correct Answer: B) 0. 57. What is the Python built-in function to converts a number to a string? A) Int(). B) ParseInt(). C) Str(). D) Convert. Show Answer Correct Answer: C) Str(). 58. Choose the correct data type:The surname of a userExample:Chapman A) Integer. B) Character. C) Boolean. D) String. E) Real/Float. Show Answer Correct Answer: D) String. 59. How do you access the last element of a list in Python? A) List name[-1]. B) List name.last. C) List name(1). D) List name[last]. Show Answer Correct Answer: A) List name[-1]. 60. Python is a ..... side programming language. A) West. B) Client. C) Server. D) East. Show Answer Correct Answer: C) Server. Next →Related QuizzesScience QuizzesClass 11 QuizzesClass 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 8Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 9 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books