0% found this document useful (0 votes)
19 views

IP - Computer Science - MCQs - SW - 2 - Q + Soln

This document is a test paper for a Computer Science revision program for Class I PreUni Plus 2024-25, consisting of 60 multiple choice questions covering topics such as problem-solving, Python programming, and flow control. Each question is worth 1 mark for a correct answer, and the test has a duration of 70 minutes. The document includes specific instructions for answering the questions and provides the correct answers for each question.

Uploaded by

superaishu2008
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)
19 views

IP - Computer Science - MCQs - SW - 2 - Q + Soln

This document is a test paper for a Computer Science revision program for Class I PreUni Plus 2024-25, consisting of 60 multiple choice questions covering topics such as problem-solving, Python programming, and flow control. Each question is worth 1 mark for a correct answer, and the test has a duration of 70 minutes. The document includes specific instructions for answering the questions and provides the correct answers for each question.

Uploaded by

superaishu2008
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/ 7

COMPUTER SCIENCE

Class I PreUni Plus 2024-25 Max. Marks 60


Revision Program Duration 70 minutes
Solution to Sectionwise MCQs - Paper - 02 Date January, 2025
Topics Introduction to Problem Solving, Getting Started with Python, Flow Control
Instructions
1. This test paper contains 60 multiple choice questions.
2. For each question there are four options of which one option is correct. Choose the correct option and darken the
appropriate circle in the response sheet.
3. Each question carries 1 mark for correct answer and 0 mark for wrong answer.

1. What is the first step-in problem-solving process?


(A) Develop a solution (B) Coding (C) Documentation (D) Define the problem
Ans (D)
2. ____________ is a process of converting the algorithm into the format which can be understood by the
computer
(A) Pseudo code (B) Algorithm (C) Flowchart (D) Program
Ans (D)
3. __________ is a process of identifying and fixing errors in the code.
(A) Keyword (B) Identifier (C) Debugging (D) Testing
Ans (C)
4. Which of the following is NOT a characteristics of a good algorithm?
(A) Finiteness (B) Precision
(C) Flexibility to change outputs randomly (D) well defined inputs and outputs
Ans (C)
5. Which of the following is NOT a common way to represent an algorithm?
(A) Pseudo code (B) Flowchart (C) Source code (D) Database Scheme
Ans (D)
6. In a flowchart which symbol is use to represent a decision
(A) Rectangle (B) Oval (C) Diamond (D) parallelogram
Ans (C)
7. Pseudocode is a representation of an algorithm that uses
(A) Only Symbols and no text (B) Programming language syntax
(C) Not a real code. (D) Binary code.
Ans (C)
8. Which of the following is an advantage of using a flowchart to represent an algorithm?
(A) Easy to debug errors in the code (B) Visual representation of the process
(C) Directly executable by a computer (D) Faster execution time.
Ans (B)
9. In a flowchart the symbol used to represent the start or end of a process is
(A) rectangle (B) diamond (C) oval (D) parallelogram
Ans (C)

1
1P2425(RP)CsSW2S(MCQs)

10. In the flowchart the parallelogram is used to represent


(A) Start or stop (B) Input /output (C) Decision making (D) Process
Ans (B)
11. Arrows in a flowchart are used to represent
(A) Represent process (B) Indicate the flow of control
(C) Denote decision making points (D) Show the start or end of the flowchart.
Ans (B)
12. Decomposition in a problem refers to
(A) Breaking down a complex problem into smaller, manageable subprogram.
(B) Combining multiple problems into one.
(C) Optimizing the speed for solution of the problem
(D) Converting problem into machine code
Ans (A)
13. What is the purpose of the if statement in python?
(A) To repeat a block of code
(B) To choose between multiple blocks of code based on a condition
(C) To declare variables.
(D) To handle exceptions.
Ans (B)
14. Which one is the correct syntax of if statement in python?
(A) if condition: Statement (B) if condition statement
(C) if(condition) statement (D) if condition then statement
Ans (A)
15. Which of the following is the correct order of parameters in the range( ) function?
(A) (start, step, stop) (B) (start, stop, step) (C) (stop, start, step) (D) (step, stop, start)
Ans (B)
16. What is the output for the following code?
x = 10
if x > 5:
print(“Greater”)
else:
print(“Smaller”)
(A) Greater (B) Smaller (C) Error (D) None
Ans (A)
17. What is the purpose of the while loop in python?
(A) To iterate over a sequence like a list or string
(B) To execute a block of code repeatedly as long as a condition is true.
(C) To iterate over elements using an index.
(D) To execute code when a condition becomes false.
Ans (B)

2
1P2425(RP)CsSW2S(MCQs)

18. Which of the following syntax is correct for an if statement in python?


(A) if x==5: (B) if(x==5) (C) if x==5 (D) if x==5
Ans (A)
19. What will the following code output?
i=1
while i<5:
print(i , end=” “)
if i==3:
break
i+=1
(A) 1 2 3 4 (B) 1 2 3 (C) 1 2 (D) none of (A), (B), (C)
Ans (B)
20. What is the correct syntax for a while loop in python?
(A) while x > 0 {print(x)} (B) while x > 0: print(x)
(C) while (x > 0):{print (x)} (D) while x > 0: print x
Ans (B)
21. What file extension is typically used for python scripts?
(A) .exe (B) .java (C) .py (D) .txt
Ans (C)
22. Which of the following is a key feature of python?
(A) Python is compiled and statically typed.
(B) Python is interpreted and dynamically typed.
(C) Python is statically typed and platform depended.
(D) Python is interpreted and statically typed.
Ans (B)
23. Which of the following is a python keyword?
(A) def (B) function (C) method (D) loop
Ans (A)
24. What is the default prompt you see when you see when you start python interactive mode?
(A) >>> (B) <<< (C) >> (D) <<
Ans (A)
25. Which of the following is a valid identifier in python?
(A) 2variable (B) my_variable (C) @myvariable (D) var@ible
Ans (B)
26. What is the rule for creating a valid identifier in python?
(A) It can start with a number
(B) It can contain spaces
(C) It can only contain letters, digits and underscores and must not start with a digit
(D) It must be a single letter
Ans (C)

3
1P2425(RP)CsSW2S(MCQs)

27. What is the first character allow in a python identifier?


(A) A digit (B) A letter (C) Underscore(_) (D) both (B) and (C).
Ans (D)
28. Which of the following is a mutable data type in python?
(A) int (B) tuple (C) Str (D) list.
Ans (D)
29. Which of the following is NOT a valid data type in python?
(A) int (B) float (C) character (D) bool
Ans (C)
30. Which of the following data type used to represent decimal number in python?
(A) int (B) float (C) complex (D) Str
Ans (B)
31. What does the type( ) function in python do?
(A) It converts one data type to another (B) It prints the value of a variable
(C) It returns the data type of a given object (D) It returns the size of a data type
Ans (C)
32. What type of the data is the following in python?
X = [1, 2, 3, 4]?
(A) Tuple (B) Set (C) List (D) dict
Ans (C)
33. Which of the following is an immutable data type in python?
(A) List (B) dict (C) tuple (D) set
Ans (C)
34. Which data type is used to store key-value pairs in python?
(A) List (B) tuple (C) dict (D) set
Ans (C)
35. What is the output of the following python code?
X = (1, 2, 3)
X[0] = 10
(A) (10, 20, 30) (B) type error (C) (1, 10, 3) (D) none
Ans (B)
36. Which of the following is an arithmetic operator in python?
(A) = (B) + (C) == (D) and
Ans (B)
37. What is the result of the expression 5%2 in python?
(A) 1 (B) 2 (C) 0 (D) None
Ans (A)
38. Which of the following is a comparison operator in python?
(A) + (B) * (C) == (D) and
Ans (C)

4
1P2425(RP)CsSW2S(MCQs)

39. __________ in a program is uniquely identified by a name.


(A) Keyword (B) Constant (C) Variable (D) Comments
Ans (C)
40. What is the data type of the following in python?
X=5
(A) float (B) int (C) Str (D) bool
Ans (B)
41. Which of the following statements about variables in python is correct?
(A) Variables in python must be declared before use.
(B) Python automatically detects the type of variable
(C) Variables in python can only hold one type of value at a time
(D) Variables in python must always be explicitly type cast
Ans (B)
42. What is the result of the following code?
x = “10”
print(type(x))
(A) >class int’> (B) <class str> (C) <class float> (D) <class bool>
Ans (B)
43. Which of the following is not valid in python data type?
(A) List (B) Tuple (C) Array (D) Dictionary
Ans (C)
44. Which of the following is a relation operator in python?
(A) = (B) = = (C) and (D) * *
Ans (B)
45. _________ function is used to output data to standard output device.
(A) input () (B) print () (C) type () (D) len ()
Ans (B)
46. _______ function is used to input data from standard input device.
(A) input () (B) print () (C) type () (D) len ()
Ans (A)
47. Which of the following is the correct syntax for a for  loop in python?
(A) for I in range (10) (B) for (i=0; i<10; i++)
(C) for I in range (10): (D) for each 1 in range(10)
Ans (C)
48. Which statement is used to exit a loop in python?
(A) exit (B) stop (C) break (D) quit
Ans (C)
49. Which of the following is a selection statement in python?
(A) if (B) while (C) for (D) break
Ans (A)

5
1P2425(RP)CsSW2S(MCQs)

50. What will be the output of the following code?


x=5
if x%2==0:
print(“Even”)
else:
print(“odd”)
(A) even (B) odd (C) error (D) none
Ans (B)
51. What is the purpose of the continue statement in a loop?
(A) To terminate the loop
(B) To skip the rest of the code inside the loop for the current iteration
(C) To pause the loop
(D) To start a new loop
Ans (B)
52. Which keyword is used to handle multiple conditions in python selection statement?
(A) else-if (B) elif (C) ele if (D) else
Ans (B)
53. What will happen if an ‘if’ condition evaluates to ‘false’ and there is no ‘else’ statement?
(A) The program will terminate with an error
(B) The program will skip the block and continue execution
(C) The program will print none
(D) The program will raise a syntax error
Ans (B)
54. The order of execution of the statement is knowns as
(A) flow of chart (B) flow of structure
(C) flow of control (D) none of these
Ans (C)
55. In a nested loop, how many times will loop execute, if the outer loop runs 3 times and inner loop runs
2 times?
(A) 3 (B) 6 (C) 2 (D) 5
Ans (B)
56. In python, incorrect indentation will lead to
(A) A warning (B) A syntax error
(C) A runtime error (D) no issue
Ans (B)
57. Which of the following is NOT a repetition structure in python?
(A) for loop (B) while loop (C) nested loop (D) do while loop
Ans (D)
58. What types of sequences can a python for loop iterate over?
(A) string (B) list (C) tuple (D) all of (A), (B), (C)
Ans (D)

6
1P2425(RP)CsSW2S(MCQs)

59. What is a while loop in python?


(A) A loop that runs a fixed number of times
(B) A loop that runs as long as a specified condition is true
(C) A loop that iterates over a sequence
(D) A loop that terminates only when manually stopped
Ans (B)
60. What is the output of the following code?
X=0
while X<3:
print (X, end=“ ”)
X+=1
(A) 0 1 2 (B) 1 2 3 (C) 0 1 2 3 (D) infinite loop
Ans (A)

***

You might also like