Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 13 (60 MCQs)

Quiz Instructions

Select an option to see the correct answer instantly.

1. What term is used to describe data passed into/out of a program?
2. C=35 if 34<43 else 43
3. What output will this code produce?
4. What does the '#' allow you to do?
5. Which one of the following is the correct way of calling a function?
6. In Python, list is mutable
7. If, else and elif is used for .....
8. The result of this program:Friday = Falseif Friday:print "Jeans day!"else:print "Uniform day"
9. In Python, iteration is another word for a:
10. What will be the output?names1 = ['Amir', 'Bala', 'Chales']if 'amir' in names1:print(1) else:print(2)
11. An expression is
12. What method is used to remove the first occurrence of a specific value from a list in Python?
13. The help statement display ..... from a module.
14. What is the output of the following lines of code?var1 = 12var1 = 23.4var1 = "I love AI!"print(var1)
15. What can we use to get the first character of a string txt= "Banana"
16. True or False:phone.number is a good name for a variable.
17. What is used to print the length of a string
18. Which logical operator is used to combine two conditions and returns True if both conditions are True?
19. Choose the correct data type:"Resolution"
20. In the following code, what type of variable is being created?foo = "bar"
21. Read the following Python code carefully and point out the global variables?y, z = 1, 2def f():global x x = y+z
22. What is the position of the name 'Paula' in the following list:names = ["Paul", "Phillip", "Paula", "Phillipa"]
23. Identify the data type of T:T = ['A', '23', '92', '(10, 20)']
24. What will happen when we run this:Yourname = input()print ("Hi there, ", yourname)
25. Which of the following is an acceptable variable name?
26. What would be the output of the following code:for i in range(3):print(5)
27. All keyword in python are in
28. In order to move the turtle 120 forward without drawing on the screen, which order is correct?
29. Which of the following does not work in Lists?
30. What can a variable not start with?
31. In order to store values in terms of key and value we use what core data type.
32. In the following code, what type of variable is being created?foo = 3.5
33. What is the output of the following range() function?for num in range(2, -5, -1):print(num, end=", ")
34. 4 is 100 in binary and 11 is 1011. What is the output of the following bitwise operators? a = 4b = 11print(a | b)print(a >> 2)
35. Is the following piece of code valid?>>> a=(1, 2, 3, 4)>>> del a
36. What kind of expression must be used as part of the "while" loop statement?
37. What Python command is used to output text to the screen?
38. What data value would store the value:9?
39. Python uses ..... to define program blocks.
40. What will the output be from the following code?print(9/3*2+4-5)
41. A variable is a named value that can be changed in the program.
42. What computer science concept stores information to be used later?
43. This statement is used to evaluate only one condition
44. What is the output of the following piece of code?class Test:def ..... init ..... (self):self.x = 0class Derived ..... Test(Test):def ..... init ..... (self):Test ..... init ..... (self) self.y = 1def main():b = Derived ..... Test() print(b.x, b.y)main()
45. What type of loop do you use to loop through a list?
46. We need import turtle at the top of the code to use Python turtle?
47. What is the output of the followingaList = [5, 10, 15, 25]print(aList[::-2])
48. What will be output for the folllowing code?class test:def ..... init ..... (self, a):self.a=a def display(self):print(self.a)obj=test()obj.display()
49. What is the output of the following list assignmentaList = [4, 8, 12, 16]aList[1:4] = [20, 24, 28]print(aList)
50. To repeat a fixed number of times use a
51. Which of the following for loops would print the following numbers?3 5 7 9
52. Which keyword is used to display output in Python?
53. Which kind of loop would be used?I need a program that will keep letting me add money to a piggy bank until I get to $ 100.
54. What is the output of program below?motorcycles = ['honda', 'yamaha', 'suzuki']motorcycles.sort()print(motorcycles)
55. In the following code, what is happening?foo = "bar"
56. Game.spawnPlayerXY("captain", 9, 18)How many arguments does the spawnPlayerXY( ) method use here?
57. Identify the code that properly creates an instance of a class named Car.
58. What is a piece of code that can take inputs to perform a certain task?
59. Which of the following programs prints ten lines?
60. Look at the following code:age = input ("What is your age? ")age = age + 1print (age)If the user inputs 23, what is the result of the code?