0% found this document useful (0 votes)
667 views28 pages

Ch-03: Programming Fundamentals - MCQs - PDF

The document contains multiple-choice questions related to programming fundamentals for Class 11 Computer Science. It covers topics such as program execution, programming languages, variable naming, error types, and Python-specific functions and operations. The questions aim to assess the understanding of basic programming concepts and Python syntax.

Uploaded by

shahzad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
667 views28 pages

Ch-03: Programming Fundamentals - MCQs - PDF

The document contains multiple-choice questions related to programming fundamentals for Class 11 Computer Science. It covers topics such as program execution, programming languages, variable naming, error types, and Python-specific functions and operations. The questions aim to assess the understanding of basic programming concepts and Python syntax.

Uploaded by

shahzad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Computer Science Class-11

Chapter
03 Programming Fundamentals
MULTIPLE CHOICE QUESTIONS
1. A set of well-defined instructions which a computer can execute to solve a
problem is called:
a. Program b. Computer
c. Interpreter d. Programming language
2. When a computer program is executed, it is loaded into:
a. Main memory b. Processor
c. Secondary storage d. Cache memory
3. During execution of a program, the computer stores the program and data
related to the program in:
a. Main memory b. Processor
c. Secondary storage d. Printer
4. The primary reason for keeping both the program and data in main memory
during execution is:
a. To ensure data is not last b. For faster execution
c. For backup purposes d. To prevent errors
5. An interactive program typically requires:
a. User input during execution b. Constant Internet connection
c. No user interaction d. Running the background
6. Which program type typically requires the user to enter data while it’s
running?
a. Interactive program b. Batch program
c. Both require user input d. Neither require user input
7. Which of the following is an example of an interactive program?
a. Chat Applications b. Web browser
c. Video games d. All of Above

1|P age
Computer Science Class-11

8. Computer programs are developed in:


a. Programming languages b. Compilers
c. Machine code d. Operating systems
9. The set of Instructions created using keywords is called:
a. Syntax b. Code
c. Object file d. Compiler
10. The rules that must be followed when writing a program are called:
a. Keyword b. Semantic
c. Punctuation d. Syntax
11. Which of the following is not a programming language?
a. Python b. JavaScript
c. Ruby d. Photon
12. Which of the following defines the rules and keywords used to develop a
computer program?
a. Programming language b. Compiler
c. Hardware interface d. Operating system
13. _____ is the set of instructions that programmers have written in a higher-
level language programming.
a. Executable code b. Base code
c. Compiled code d. Source code
14. The language in which instructions are written in binary form is called:
a. Machine language b. Assembly language
c. Java d. Python
15. Machine language instructions are typically written in:
a. English b. Binary
c. Assembly language d. C++

2|P age
Computer Science Class-11

16. Which of the following is NOT a type of language transistor?


a. Compiler b. interpreter
c. Assembler d. Editor
17. ______ translates high-level language program into machine language
program.
a. Assembler b. Compiler
c. Debugger d. CPU
18. What happens of the syntax of the code is incorrect in a programming
language?
a. The code is automatically corrected b. The compiler generates an error
c. The object file is created with errors
d. The development environment changes
19. ______ translate source code into machine code line-by-line and execute it
immediately.
a. Debugger b. Assembler
c. Interpreter d. Compiler
20. _____ translates an assembly language program to a machine language
program.
a. Assembler b. Compiler
c. Interpreter d. Loader
21. Computer can only execute the program written in:
a. Machine language b. Assembly language
c. Java d. Python
22. The process that converts program code into machine language is called:
a. Documentation b. Debugging
c. Compilation d. Execution
23. The code directly understood by the computer’s processor is:
a. Source code b. Machine code
c. Base code d. None

3|P age
Computer Science Class-11

24. Object files are typically generated by:


a. Text editor b. Debugger
c. Interpreter d. Compiler
25. Which of the following languages commonly uses a compiler?
a. C++ b. Java
c. Fortran d. All of above
26. Which of the following languages commonly uses an interpreter?
a. Python b. JavaScript
c. Ruby d. All of above
27. When was Python introduced?
a. 1985 b. 1992
c. 2000 d. 2010
28. Which programming language is widely used in Data Science for data analysis?
a. Python b. C++
c. JavaScript d. Fortran
29. Python is considered as:
a. High Level b. Object-Oriented
c. Human-friendly d. All of above
30. What kind of programming language is Python?
a. Closed-source b. Proprietary
c. Open-source d. Compiled
31. Which of the following is a Python web development framework?
a. Dyango b. Pyramid
c. Flask d. All of above
32. IDE stands for:
a. Integrated Digital Environment
b. Integrated Development Environment
c. Integrated Desktop Environment d. Internal Disk Error

4|P age
Computer Science Class-11

33. Which of the following is an online IDE for writing and executing code?
a. Replit b. PyCharm
c. Visual Studio d. Eclipse
34. IDLE stands for:
a. Interactive Data Language Explorer
b. Integrated Development and Learning Engine
c. Integrated Development and Learning Environment
d. Interactive Debugging and Learning Environment
35. The prompt that indicates that Python shell is ready to accept commands is:
a. >> b. >>>
c. # d. $
36. What is Replit?
a. Online IDE b. Programming language
c. Python library d. Website
37. The primary function of Replit is:
a. Play video games b. Write and execute code
c. Create social media posts d. Send emails
38. The extension for Python files is:
a. .pi b. .py
c. .python d. .p
39. A ______ is a name that refers to a value in the computer’s memory.
a. Variable b. Register
c. RAM d. Byte
40. Variable names cannot begin with:
a. Number b. Underscore
c. Upper-case letter d. Lower-case letter

5|P age
Computer Science Class-11

41. The variable names in Python cannot contain:


a. Digits b. Underscore
c. Alphabets d. Period
42. Which of the following is a valid variable?
a. $cost b. max_radius
c. mile d. Both b and c
43. Which of the following is a invalid variable?
a. GRAPH b. _cust_num
c. 2dGraph d. jan2024
44. Which of the following is / are NOT legal variable(s)?
a. cust num b. spAm
c. spaml d. Both a and c
45. How are ‘Num’ and ‘num’ treated in a Python program?
a. As the same variable b. As two separate variables
c. As an error d. As a function
46. The error in a computer program is commonly referred to as:
a. Bug b. Malware
c. Glitch d. Defect
47. A _______ error occurs when the rules of the programming language are not
followed:
a. Syntax b. Runtime
c. Logical d. Program
48. An error in the program’s logic that produces incorrect results is called:
a. Logical bug b. Security bug
c. Performance bug d. Compatibility bug
49. What is the main goal of writing instructions in a proper order?
a. To ensure faster execution b. To improve code readability
c. To avoid syntax errors d. To implement logic correctly

6|P age
Computer Science Class-11

50. Which of the following is the simplest method to find a logical bug?
a. Dry Running the code b. Rewriting the entire code
c. Compiling the entire code d. Checking variable names
51. Which type of errors can be most effectively identified through a dry run?
a. Syntax errors b. Runtime errors
c. Logical errors d. Compilation errors
52. The primary activity involved in a dry run is to:
a. Execute program on computer b. Execute program on paper
c. Test application’s user interface d. Automatically correct syntax errors
53. Which of the following is a valid data type in Python?
a. char b. integer
c. float d. All of above
54. What is the data type of the value 3.14?
a. char b. integer
c. float d. Boolean
55. Which data type is used to represent True or False values?
a. char b. integer
c. float d. Boolean
56. The method to assign a value of 5 to the variable x in Python is:
a. x=5 b. x==5
c. var x=5 d. (x) == 5
57. The function used to take user input as a string and store it in a variable in
Python is:
a. read() b. input()
c. get_input() d. get()
58. The input() function in Python returns:
a. integer b. string
c. Boolean d. float

7|P age
Computer Science Class-11

59. The function used to display output in Python is:


a. print() b. display()
c. output() d. show()
60. The correct way to use input() function to input user name is:
a. name = input(“Enter your name:”) b. name = input(Enter your name:)
c. name = input(‘Enter your name:’) d. name = “input(Enter your name)”
61. The process of joining two strings in Python is:
a. Addition b. Multiplication
c. Concatenation d. Subtraction
62. The operator used for string concatenation in Python is:
a. +- b. -
c. * d. /
63. What will be the output of the code?
a. Hello, World! b. hello, world!
c. Hello World d. “Hello, World!”
64. How can you print the value of a variable x using the print() function?
a. print(x) b. print(“x”)
c. print(‘value_of(x)’) d. print(“value_of(x)”)
65. The correct way to print multiple items separated by a space using print()
function is:
a. print(“Hello” + “World”) b. print(“Hello”,”World”)
c. print(“Hello” “World”) d. print(“Hello”.”World”)
66. What will be displayed by the following code?
x=1
x=3*x+1
Print (x)
a. 1 b. 2
c. 3 d. 4

8|P age
Computer Science Class-11

67. What will be displayed by the following code?


x=2
x = x + 3.5
print (x)
a. 2 b. 3
c. 5 d. 5.5
68. The function in Python that evaluates a string as a Python expression is:
a. eval b. input
c. print d. type
69. Which of the following expressions can eval() evaluate?
a. eval(‘3 + 5’) b. eval(“Hello” + “” + “World!”)
c. eval(‘10/2’) d. All of above
70. What will eval(“2 ** 3”) return?
a. 6 b. 8
c. “2 ** 3” d. “8”
71. What will eval (“10/2”) return?
a. 5 b. 5.0
c. “15/3” d. “5.0”
72. What is the result of: eval(“10 // 3”)?
a. 3.3333 b. 3
c. 4 d. “10 // 3”
73. What is the result of the following code?
ans = eval(‘3 + 5 * 2’)
print(ans)
a. 9 b. 13
c. 8 d. 10

9|P age
Computer Science Class-11

74. What is the output of the following code?


x=5
print(eval(‘x + 5’))
a. 10 b. 55
c. x+10 d. error
75. In the expression 20 / 5, the values on the left and right of the / symbol are
called:
a. Operators b. Operands
c. Parameters d. Arguments
76. The operator used to calculate the remainder of a division in Python is:
a. * (multiplication) b. – (subtraction)
c. %(modulus) d. / (division
77. The modulus operator in Python is:
a. + b. **
c. // d. %
78. The result of the expression 9 % 4 is:
a. 1.25 b. 1
c. 5 d. 4
79. The // operator in Python represents:
a. Exponentiation b. Modulus
c. Integer division d. Bitwise AND
80. The result of the expression 5 // 4 in Python is:
a. 1.25 b. 5
c. 0 d. 1
81. The result of the expression 3 // 5 in Python is:
a. 1.25 b. 5
c. 0 d. 1

10 | P a g e
Computer Science Class-11

82. The result of 45 / 4 in Python is:


a. 10 b. 11
c. 11.25 d. 12
83. The result of 7 / 4 in Python is:
a. 10 b. 11
c. 11.25 d. 12
84. What is the result of 45 // 4?
a. 10 b. 11
c. 11.25 d. 12
85. The operator used for exponentiation (raising a number to a power) in Python
is:
a. ^ b. **
c. exp() d. ^^
86. How do you calculate the square of a number (e.g 52) in Python?
a. 5 ** 2 b. 5 ^ 2
c. 5 % 2 d. 5 >> 2
87. The result of the expression 2 ** 3 in Python is:
a. 5 b. 6
c. 8 d. 9
88. The expression 2 * 3 ** 2 evaluates to:
a. 36 b. 18
c. 12 d. 81
89. What is the result of evaluating 2 + 2 ** 3 / 2?
a. 5 b. 3
c. 4.0 d. 6.0
90. What is the output of the Python statement? print(]4 + 10 // 4 -2)
a. 4 b. 12
c. 14 d. 15

11 | P a g e
Computer Science Class-11

91. What is x after the following statement?


x=2
y=1
x *= y + 1
a. 1 b. 2
c. 3 d. 4
92. To add a value 1 to variable x, you can write:
a. x = 1 + x b. x += 1
c. x = x + 1 d. All of above
93. The correct sequence of arithmetic operator precedence in Python is:
a. +, -, *, /, //, % b. *, -, /, %, +, -
c. **, *, /, //, %, +, - d. /, *, %, //, +, -
94. The correct way to write the expression I = I * 3 using assignment operation in
Python is:
a. I *= 3 b. I =* 3
c. I * 3 = 1 d. I => 3
95. To add number to sum, you can write:
a. sum += number b. sum = sum + number
c. number = sum + number d. Both a and b
96. Suppose x is 1. What is the value of x after x .= 1?
a. 0 b. 1
c. 2 d. -1
97. Which of the following is not a bitwise operator in Python?
a. >> b. <<
c. ^ d. !=
98. The operator used for bitwise AND in Python is:
a. && b. ||
c. & d. !

12 | P a g e
Computer Science Class-11

99. The operator used for bitwise OR in Python is:


a. && b. ||
c. & d. !
100. The operator used for bitwise NOT in Python is:
a. ! b. ~
c. @ d. #
101. How many comparison operator does Python provide?
a. 4 b. 5
c. 6 d. 7
102. Which of the following is not a comparison operator in Python?
a. == b. !=
c. >= d. <=>
103. The result of the expression 5!=3 in Python is:
a. True b. False
c. 5 d. 3
104. The result of the expression 5 != 3 in Python is:
a. True b. False
c. 5 d. 3
105. The result of the expression of 5 < 3 in Python is:
a. True b. False
c. 5 d. 3
106. Which of the following returns True if A = 25 and B = 35:
a. A+B b. A >= B
c. A != B d. A=B
107. How many logical operators are there in Python?
a. 1 b. 2
c. 3 d. 4

13 | P a g e
Computer Science Class-11

108. Which of the following is a logical “and” operator in Python?


a. & b. &&
c. and d. ||
109. Which of the following is a logical “or” operator in Python?
a. & b. ||
c. or d. |
110. Which of the following is a logical “not” operator in Python?
a. ! b. not
c. ~ d. !=
111. The logical operator in Python that requires all conditions to be true for a true
result is:
a. or b. and
c. not d. xor
112. The logical operator in Python that requires any condition to be true for a true
result is:
a. or b. and
c. not d. xor
113. Which logical operator in Python negates the value?
a. or b. and
c. not d. xor
114. Assume x = 3 and y = 4, which of the following is true?
a. x < 4 and y < 4 b. x < 4 or y < 4
c. x > 4 and y > 4 d. x > 4 and y > 4
115. Assume x = 4 and y = 5, which of the following is true?
a. not (x == 4) b. x != 4
c. x == 5 d. x != 5

14 | P a g e
Computer Science Class-11

116. A(n) _____ expression has a value of either True or False.


a. Binary b. Decision
c. unconditional d. Boolean
117. In Python, multiple conditions can be joined by using:
a. Arithmetic operators b. Comparison operators
c. Logical operator d. Bitwise operators
118. The keyword used to create a basic conditional statement in Python is:
a. for b. return
c. if d. del
119. Which of the following is not a conditional statement in Python?
a. if b. if-else
c. if-elif-else d. for
120. Which of the following statements is used to write a single alternative decision
structure?
a. test-jump b. if
c. if-elif-else d. if-call
121. Which of the following statements is used to write a dual alternative decision
structure?
a. test-jump b. if
c. if-else d. if-call
122. ______ statement tests a condition and then takes one path if the condition is
true and another path if the condition is false.
a. if statement b. if-else
c. test-jump d. if-call
123. What will happen if the condition in an if-else statement in Python is false?
a. The program will stop b. It will execute the else block
c. It will raise an error d. It will skip to the next if

15 | P a g e
Computer Science Class-11

124. Which of the following is a valid conditional statement in Python?


a. if a = 5; b. if a == 5;
c. if a <> 5; d. if(a = 5);
125. The best option for making a decision based on multiple choices in Python is:
a. if b. if-else
c. if-elif-else d. for
126. Which keyword is used to check additional conditions if the previous
conditions fall?
a. elif b. else if
c. then d. for
127. For num = 64, which of the following is true?
a. if(num % 14 == 0) b. if(num % 15 == 0)
c. if(num % 16 == 0) d. if(num % 17 == 0)
128. If p=21, which statement will be true?
a. if(p%2==0) b. if(p%3==0)
c. if(p%4==0) d. if(p%5==0)
129. What will be the output of following code?
m = 33
if m >= 33;
print(“Pass”)
else;
print(“Fail”)
a. Fail b. Pass
c. PassFail d. FailPass

16 | P a g e
Computer Science Class-11

130. What will be the output of following code?


m=0
n=5
if m %n > 1;
print(“Success”)
else;
print(“Looser”)
a. Success b. Looser
c. “Success” d. “Looser”
131. Which control structure in Python is used to repeat a block of code multiple
times?
a. Loop b. Conditional
c. Sequential d. None
132. Which of the following is a valid loop construct in Python?
a. for b. while
c. do-while d. both a and b
133. One execution of a loop is known as:
a. Cycle b. Duration
c. Iteration d. Test
134. Which function in Python is used to generate a sequence of numbers?
a. range() b. len()
c. randint() d. eval()
135. The range() function in Python is used to:
a. Generate a random number b. Create a sequence of numbers
c. Convert numbers to strings d. Sort a list of numbers
136. What is the default start value of the range() function if only one argument is
provided?
a. 0 b. 1
c. -1 d. None

17 | P a g e
Computer Science Class-11

137. The function range(5) in Python returns a sequence of:


a. 1, 2, 3, 4, 5 b. 0, 1, 2, 3, 4, 5
c. 1, 2, 3, 4 d. 0, 1, 2, 3, 4
138. Which of the following correctly generates a sequence of 0, 1, 2, 3?
a. range(0, 3) b. range(0, 4)
c. range(3) d. range(5)
139. The range(2, 6) function in Python produces a sequence from:
a. 2 to 5 b. 2 to 6
c. 1 to 6 d. 1 to 5
140. The correct option to generate a sequence of even numbers from 2 to 10 using
the range() function is:
a. range(2, 10) b. range(0, 10, 2)
c. range(2, 12, 2) d. range(2, 10, 2)
141. The range (5, 15, 3) function in Python produces:
a. 5, 8, 11, 14 b. 5, 8, 12, 15
c. 6, 9, 12, 15 d. 5, 10, 15
142. Turtle Graphics is a:
a. Programming language b. Graphics library in Python
c. Computer hardware d. Video game
143. Which module in Python is used for Turtle Graphics?
a. Graphics b. Turtle
c. Draw d. Canvas
144. The first statement typically used when working with turtle graphics in Python
is:
a. draw_circle(radius) b. import turtle
c. create_screen() d. show_turtle

18 | P a g e
Computer Science Class-11

145. Which of the following shapes can you draw using Turtle Graphics?
a. Triangle b. Square
c. Circle d. All of above
146. The basic line drawing functions in turtle graphics are:
a. draw_line() and move_line() b. forward() and backward()
c. draw() and move() d. line_next() and line_back()
147. In Turtle graphics, what unit is used to measure distance in forward() and
backward() functions?
a. inches b. pixels
c. centimeters d. meters
148. What command is used to turn the turtle to the right in Turtle Graphics?
a. turn_right() b. right()
c. rotate_right() d. turn()
149. Which command is used to draw a circle with a specified radius in Turtle
Graphics?
a. turtle_circle() b. turtle.draw_circle()
c. tirtle.arc() d. turtle.draw()
150. Which of the following can be used to draw a circle with radius 50?
a. turtle.circle(50) b. turtle.circle(100)
c. turtle.drawcircle(50) d. turtle.drawCircle(50)
151. Which command is used to draw a simple dot in Python?
a. turtle.circle() b. turtle.dot()
c. turtle.point() d. turtle.draw()
152. Which command is used to change the turtle’s drawing color in Python?
a. turtle.penup(color) b. turtle.pendown(color)
c. turtle.pencolor(color) d. turtle.fillcolor(color)

19 | P a g e
Computer Science Class-11

153. How do you change the turtle’s drawing color to green?


a. turtle.color(‘green’) b. turtle.pencolor(‘green’)
c. turtle.fillcolor(‘green’) d. turtle.setcolor(‘green’)
154. Which command is used to turn the turtle right by 90 degrees?
a. turtle.left(90) b. turtle.turn(90)
c. turtle.right(90) d. turtle.rotate(90)
155. Which command lifts the pen from canvas so the turtle moves without
drawing a line?
a. turtle.liftI() b. turtle.penup()
c. turtle.moveup() d. turtle.up()
156. Which command is used to lower the pen so that moving the turtle draws a
line?
a. turtle.movedown() b. turtle.pendown()
c. turtle.lowerpen() d. turtle.down()
157. Which command is used to clear all drawings and resets the turtle’s position
and drawing color?
a. turtle.clean() b. turtle.hideturtle()
c. turtle.reset() d. turtle.erase()
158. Which library can be used in Python to handle date and time?
a. dates b. sys
c. datetime d. years
159. A ______ is a pre-written set of code designed for a particular task?
a. Library b. List
c. Keywords d. Code
160. How do you typically import a library in Python?
a. include library_name b. load library_name
c. import library_name d. use library_name

20 | P a g e
Computer Science Class-11

161. Which of the following is used to format a datetime object into a string?
a. strftime() b. range()
c. len() d. randint()
162. Which of the following is the correct syntax to use strftime()?
a. datetime_strftime(format) b. strftime(datetime, format)
c. datetime_object_strftime(format) d. format.strftime(datetime_object)
163. How would you format a datetime object to show the day of the week using
strftime()?
a. %D b. %w
c. %M d. %A
164. Which format code represents name of the month in strftime()?
a. %B b. %m
c. %M d. %A
165. The format code %Y in the strftime() function represents _____ in Python.
a. Day of the month b. Month of the year
c. Year with century d. Hour (24-hour clock)
166. Which format string can be used with strftime() to display date as “Monday,
January 1, 2024”?
a. %A, %B, %d, %Y b. %S, %B %d, %Y
c. %M %d %S, %Y d. %Y, %B %A, %H
167. Which of the following statements about lists is TRUE?
a. Can only contain numbers b. Can be modified after creation
c. Cannot store duplicate elements d. Can only contain strings
168. In Python, the mutable data type among the given option is:
a. int b. float
c. tuple d. list

21 | P a g e
Computer Science Class-11

169. What is the syntax for using the Index() function in Python lists?
a. list.Index(value) b. index(list, value)
c. value.index(list) d. list.Index()
170. How does Index() function handle multiple occurrences of the specified value
in the list?
a. Returns index of last occurrence b. Returns index of first occurrence
c. Returns a list of all positions d. Returns an error
171. Suppose list1 is (3, 4, 5, 20, 5, 25, 1, 3) what is list1.Index(5)?
a. 0 b. 4
c. 1 d. 2
172. What index() returns if the specified value is not found in the list is?
a. None b. -1
c. 0 d. An error
173. How do you access the last element of a list named myList?
a. myList[0] b. myList[-1]
c. myList[len(myList)] d. myList[-2]
174. The Index number of the last element in any list with 5 elements is:
a. 5 b. 4
c. 0 d. 1
175. Supplies list1 is [1, 3, 2, 4, 5, 2, 1, 0], what is list1[-1]?
a. 3 b. 5
c. 1 d. 0
176. Which of the following is the correct way to create an empty list in Python?
a. list = {} b. list = []
c. list = [None] d. list = None
177. Which of the following is the correct way to create list in Python?
a. list1 = {} b. list1 = [12, 4, 4]
c. list1 = [1, “3”, “red”] d. All of above

22 | P a g e
Computer Science Class-11

178. What will the following code print?


my_list = [1, 2, 3]
print(my_list)
a. 1, 2, 3 b. (1, 2, 3)
c. “1, 2, 3” d. [1, 2, 3]
179. What will be the output of the following code?
my_list = [1, 2, 3, 4, 5]
print(my_list[2])
a. 2 b. 3
c. 4 d. 1
180. Which of the following functions return the length of a list?
a. len() b. count()
c. size() d. length()
181. Suppose list1 is [3, 4, 5, 20, 5, 25, 1], what is len(list1)?
a. 6 b. 7
c. 8 d. 5
182. Suppose list1 is [3, 4, 5, 20, 25, 1, 3], what is max(list1)?
a. 5 b. 4
c. 8 d. 25
183. Give the list list1 = [3, 4, 5, 20, 25, 1, 3], min(list1) will return:
a. 1 b. 4
c. 8 d. 9
184. Given the list list1 = [2, 3, 4], sum(list1) will return:
a. 7 b. 6
c. 8 d. 9

23 | P a g e
Computer Science Class-11

185. Which of the following methods is used to add an element to the end of a list
in Python?
a. append() b. add()
c. insert() d. extend()
186. Which of the following can be used to add 5 to the end of list1?
a. list1.add(5) b. list1.append(5)
c. list1.addLast(5) d. list1.addEnd(5)
187. Which method is used to insert an element at a specific position in a list?
a. add() b. insert()
c. append() d. put()
188. Which of the following can be used to insert 5 to the third position in list1?
a. list1.insert(3, 5) b. list1.insert(2, 5)
c. list1.add(3, 5) d. list1.append(3, 5)
189. Which of the following statement about the abs() function is true?
a. it always returns a positive value b. it modifies the original number
c. it squares the value of a number d. it only works with integers
190. Which of the following is not a valid use of the abs() function in Python?
a. abs(-8) b. abs(2)
c. abs(‘pas’) d. abs(-4.5)
191. What is the output of the code? Print(abs(-2.5))
a. 2.5 b. 2
c. 5 d.
192. What will be the output of the code? Print(abs(3.5))
a. -3.5 b. 3
c. 3.5 d. 0.5

24 | P a g e
Computer Science Class-11

193. A ______ in Python is used to check whether a particular element exists in a


list.
a. Logical operator b. Comparison operator
c. Membership operator d. Arithmetic operator
194. Which of the following is a membership operator in Python?
a. or b. and
c. not in d. not
195. Which membership operator is used to check if a value exists in a list?
a. in b. not in
c. and d. or
196. The membership ____ operator checks if a value does not exists in a list?
a. in b. not in
c. not d. null
197. What will the following code print?
my_string = ‘Python’
print(‘t’ in my_string)
a. True b. False
c. ‘t’ d. ‘False’
198. What is the output of the following code?
my_list = [1, 2, 3, 4, 5]
print6 not in my_list)
a. True b. False
c. Error d. None
199. The function to generate random numbers in Python is:
a. range() b. randin()
c. len() d. eval()

25 | P a g e
Computer Science Class-11

200. Which module needs to be imported for using randint() function?


a. random b. math
c. randomize d. rand
201. The randint() function in Python returns:
a. Integer b. Float
c. String d. Boolean
202. A block of code that can be reused to perform a specific task is called:
a. Function b. Variable
c. List d. Constant
203. The keyword used to define a function in Python is:
a. def b. function
c. define d. func
204. The correct way to define a function in Python is:
a. function add(a, b); b. def add(a, b);
c. define add(a, b); d. define_function add(a, b);
205. A function is executed when it is:
a. defined b. prototyped
c. declared d. called
206. Which of the following is a valid function call in Python?
a. functionName b. functionName()
c. functionName{} d. functionName[]
207. What happens when function is called?
a. The control moves to the function that is called
b. All statements in the function body are executed
c. The control returns back to the calling function
d. All of these

26 | P a g e
Computer Science Class-11

208. The term used to describe the value passed to a function when it is called is:
a. Parameters b. Variables
c. Arguments d. Constants
209. The arguments to function in Python always appear within:
a. Brackets b. Parentheses
c. Curly Braces d. Quotation Marks
210. How many values can be passed to the function?
a. One b. Two
c. Three d. Many
211. In Python, a function can return:
a. One value b. Two values
c. Three values d. Any number of values
212. The keyword used to specify the value returns by a function in Python is:
a. return b. call
c. output d. exit
213. A variable define inside a function is known as:
a. Local variable b. Global variable
c. Main variable d. External variable
214. A variable define outside a function is known as:
a. Local variable b. Function variables
c. Global variables d. Main variables
215. The process of finding and removing errors in the program is called:
a. Compiling b. Debugging
c. Executing d. Coding
216. In Python, a _____ is a tool to find and fix errors in code.
a. Debugger b. Fault Finder
c. Error Tracker d. Linter

27 | P a g e
Computer Science Class-11

217. A _______ in debugging is used to pause program execution at a specific line


of code.
a. Breakpoint b. Function
c. Variable d. Comment

28 | P a g e

You might also like