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?
2. The code you use to receive and input from the keyboard
3. Which of the following statement is true between char and string data types?
4. What is the correct order of the following?
5. If L1=[2, 4, 8, 16] What is the result of the following statement16 in L1
6. If function definition has no content, then what statement to be used to avoid getting an error.
7. Which one is not true about function?
8. "def" keyword is used in python to-
9. Which of the following correctly stores 'price' as a decimal number?
10. What key word describesThe process of defining the 'type' of a piece of data?
11. Which kind of loop would be used?I need a program that will keep letting me add a monthly payment for 12 months.
12. Kind of loop used when you know the number of times you want it to repeat
13. Suppose list1 is [1, 5, 9], what is sum(list1)?
14. What is the output of the following code?str = "pynative"print (str[1:3])
15. How do i remove something from the end of a list?
16. What brackets are used to create a list?
17. Choose the correct data type:Attendance of a studentExample:yesExample 2:no
18. Which of the following symbols is used in the beginning of a line to create a single line comment in Python?
19. What is the result of following Program in python3for i in range(1, 4):print(i)if(i==2):continue;
20. In Python script editor, the errors will be shown in ..... color in the IDLE window?
21. A Python dictionary stores .....
22. How do Burmese Pythons affect the food chain in the Everglades?
23. A # in Python means the user is trying to .....
24. Sonam has written this program in Python. One of the lines contains at least one error. Which line is it?
25. What is the result of the following condition if:A = 30B = 21C = 71B != A or C < A
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.
27. An empty list can be declared as
28. Consider the code:a=21; b=6print(a/b); print(a//b); print(a%b) What is the result?
29. Comparison Operators:Select the correct operator for equals to
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()
31. While True: ..... breakWhat does a break statement do inside the "While-True" loop
32. What is the output of the following code?p, q, r = 10, 20, 30print(p, q, r)
33. Names = ["Hyderabad", "New Delhi", "New York"]What gets printed when you saynames[1][-1]
34. An exception can be manually triggered by the command
35. What is elif in Python?
36. What is a Count-Controlled loop?
37. Mylist = ["a", "b"]mylist[1] = "c"'print(mylist)
38. What is the output of program below?mariana ..... islands = ['Saipan', 'Tinian', 'Rota']mariana ..... islands.append('Guam')print(mariana ..... islands)
39. Which of the following would be an example of a float variable:
40. What is one of the ecological impacts of Burmese Pythons in Florida?
41. What is the output when we execute list( "hello" )?
42. A loop that repeats forever until the level is beaten
43. Which is NOT a data type in Python?
44. In Python, Dictionaries are
45. Look at the following code:L = 50W = 30Area = L * Wprint ("Area")What is the result of this code?
46. If I want to store my name in a variable, which of the following would be a good variable name in best practice?
47. What concept repeats whatever is inside it?
48. Str="world of python programming"print(str[0:5])
49. In python the ' BOOLEAN data type' can be defined as ..... ?
50. Any statements inside an IF clause (section) can be executed multiple times.
51. Repeat a block of code while a certain condition is true (they do not go on forever).
52. If foo is equal to 'bar', what is the value of foo after this operation?foo += 3
53. Which of the following allow to name the various parts of a multi-item object?
54. ..... data type represent one of two values either True or False such as 1, 0, 2 > 1, 3 < 2.
55. What is the output of the following code:print 5//2
56. In Python, a variable needs to
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")
58. What data type represents characters?
59. Which of the following assign the value 50 to a variable x?
60. What are the lines of code called in a program?