12CS_EM_2025
12CS_EM_2025
COMPUTER SCIENCE
வாழ்த்துகளுடன்
அ. பிரபாகர்
RASIPURAM
PREFACE
It has been prepared keeping all students in mind with the primary motto
" - என்றும் மாணவர்கள் நலனில்".
Simplicity and elegant answers have been effectively prepared by teachers with
more than 20 years of experience with a view to achieving full marks.
Keeping in view the public examination answer keys, the answers, Python syntaxes,
examples with explanation and output are provided in a better understandable
manner.
Following the book questions for each subject, all the questions asked from within
the chapter in the Public Examination and PTA questions are answered. Additional
questions have been given with emphasis on mandatory questions.
A QR code is attached to the title of each lesson. With these, we can always answer
the quiz through our smart phone and know the marks obtained instantly.
Through QR Codes in the guides, one can download the following full
pdf at anytime:
(Minimum learning material)
(set of model question papers and public exam papers)
(set of questions not to be missed at the last moment)
Best Wishes to Get Full Marks and a successful future.
93452 99522
ன் இதர வெளியீடுகள்
XI, XII கணினி அறிவியல் (TM & EM)
XI, XII கணினி பயன்பாடுகள் (TM & EM)
XI, XII வேலைோய்ப்புத் திறன்கள் (TM மட்டும்)
1 FUNCTION
Part - I
Choose the best answer: 1 Mark
(Jul 2022)
b) Function
(Mar 2022, PTA-6)
c) Definition
(Jun 2023, PTA-2)
d) Parameters
(Jul 2024)
a) Arguments
(PTA-4)
b) ()
(Mar 2024)
c) Interface
c) Implementation
d) Pure functions
a) Impure function
Part - II
Answer the following questions: 2 Marks
1. What is a subroutine? (PTA-1)
..1.. A. PRABHAKAR-9442979144
– 1. FUNCTION
2. Define Function with respect to Programming language. (Sep 2021)
5. Which of the following is a normal function definition and which is recursive function
definition?
i) let sum x y: return x + y
ii) let disp:
print ‘welcome’
iii) let rec sum num:
if (num!=0) then return num + sum (num-1)
else
return num
Answers:
Part - III
Answer the following questions 3 Marks
1. Mention the characteristics of Interface. (Sep 2020, Mar 2023, Jul 2024)
➢
..2.. A. PRABHAKAR-9442979144
– 1. FUNCTION
4. Differentiate pure and impure function. (Mar 2020, Mar 2024, PTA-6)
Pure Function Impure Function
5. What happens if you modify a variable outside the function? Give an example.
Part - IV
Answer the following questions 5 Marks
1. What are called Parameters and write a note on (May 2022, Jul 2024, PTA-2)
(i) Parameter without Type (ii) Parameter with Type
Parameter:
..3.. A. PRABHAKAR-9442979144
– 1. FUNCTION
❖
Example:
..4.. A. PRABHAKAR-9442979144
– 1. FUNCTION
Impure function: (PTA-5)
❖
.
Implementation:
ENGINE
getSpeed
No
Requir
ed Pull Fuel
Yes
Return
➢
➢
..5.. A. PRABHAKAR-9442979144
– 1. FUNCTION
(Sep 2020)
c) Subroutine
(PTA-1)
d) recursive function
ADDITIONAL QUESTIONS
c) let
a) rec
a) static
b) Pure functions
b) c) random() d)
c) Objects
7. What are parameters and arguments?
❖
❖
8. What is recursive function?
9. `How will you solve the problem of chameleons in chrome land? Describe by
algorithm and flowchart?
➢
..6.. A. PRABHAKAR-9442979144
– 1. FUNCTION
--inputs:
--outputs:
Example:
iteration a b c
0 4 4 6
1 3 3 8
2 2 2 10
3 1 1 12
4 0 0 14
Algorithm:
Flowchart:
..7.. A. PRABHAKAR-9442979144
2 DATA ABSTRACTION
Part - I
Choose the best answer: 1 Mark
b) List
(Mar 2020, Jun 2023, Jul 2024)
c) Tuple
(Mar 2023, PTA-2)
c) Concrete datatype
(Mar 2024)
d) Abstract datatype
a) Pair
(PTA-4)
a) Pair
c) Classes
b) Lists
Part - II
Answer the following questions: 2 Marks
1. What is abstract data type? (Sep 2021, May 2022, Mar 2024)
2. Differentiate constructors and selectors. (Jul 2022, Jul 2024, PTA-2, PTA-3)
➢
➢
3. What is a Pair? Give an example. (Mar 2020, Jun 2023)
➢
..8.. A. PRABHAKAR-9442979144
– 2. DATA ABSTRACTION
➢
Example:
4. What is a List? Give an example.
➢
Example:
5. What is a Tuple? Give an example. (Mar 2023)
Example:
Part - III
Answer the following questions: 3 Marks
1. Differentiate Concrete data type and abstract datatype.
Concrete data type Abstract datatype
1] Multiple assignment:
Example:
..9.. A. PRABHAKAR-9442979144
– 2. DATA ABSTRACTION
2] Element selection operator:
Example:
➢
➢
2. What is a List? Why List can be called as Pairs? Explain with suitable example.
(Mar 2023, PTA-6)
➢
..10.. A. PRABHAKAR-9442979144
– 2. DATA ABSTRACTION
Example:
(PTA-1)
)
) d) Abstract Data Type
2. (PTA-5)
c) either A or B
(PTA-6)
b) Parts of a program
..11.. A. PRABHAKAR-9442979144
– 2. DATA ABSTRACTION
a) Abstraction
d) Modularity
b) Classes
a) Pairs
b) 2
)
c) Concrete Data Type )
b) 2
b) [ ] c) )
a) ( ) ) ) )
b) Wishful thinking
d) Comma(,)
c) i, iii Only
a) Class
14. What is abstraction?
..12.. A. PRABHAKAR-9442979144
– 2. DATA ABSTRACTION
➢
Example:
➢
→
→
The pseudo code for the representation of the rational number using the above
constructor and selector is
..13.. A. PRABHAKAR-9442979144
3 SCOPING
Part - I
Choose the best answer: 1 Mark
a) Scope
(Sep 2020, Sep 2021)
b) Mapping
(PTA-2)
c) =
(May 2022)
d) Namespaces
(Jul 2022)
a) Local Scope
b) Modular programming
(Mar 2024)
c) Access control
d) Private members
(Mar 2023)
a) Public members
(PTA-6)
b) Protected members
..14.. A. PRABHAKAR-9442979144
– 3. SCOPING
Part - II
Answer the following questions: 2 Marks
1. What is a scope? (Mar 2023)
4. What do you mean by Namespaces? (Mar 2020, Jul 2022, Jul 2024, PTA-4)
➢
Part - III
Answer the following questions: 3 Marks
1. Define Local scope with an example. (Sep 2021)
➢
➢
Example: Output:
→ local scope
..15.. A. PRABHAKAR-9442979144
– 3. SCOPING
Example: Output:
→ global scope
→ local scope
Example: Output:
→ enclosed scope
5. Identify the scope of the variables in the following pseudo code and write its output.
color:= Red
mycolor():
b:=Blue
myfavcolor():
g:=Green
print color, b, g
myfavcolor()
print color, b
mycolor()
print color
Scope of variables: Output:
→ global scope
→ enclosed scope
→ local scope
..16.. A. PRABHAKAR-9442979144
– 3. SCOPING
Part - IV
Answer the following questions: 5 Marks
1. Explain the types of scopes for variable or LEGB rule with example.
(Sep 2020, Sep 2021, May 2022, Mar 2024, PTA-1)
Local scope:
➢
➢
.
Enclosed scope:
➢
➢
Global scope:
➢
Built-in scope:
➢
..17.. A. PRABHAKAR-9442979144
– 3. SCOPING
Example:
→ library files
→ global scope
→ enclosed scope
→ local scope
Output:
2. Write any Five Characteristics of Modules. (Sep 2020, Jun 2023, Jul 2024, PTA 4, PTA 6)
1.
2.
3.
4.
5.
3. Write any five benefits in using modular programming.
❖
❖
❖
❖
❖
❖
(PTA-1)
c) Enclosed
(PTA-3)
a) Built-in scope variables
..18.. A. PRABHAKAR-9442979144
– 3. SCOPING
(PTA-5)
c) class
Define module. (PTA-4)
➢
➢
➢
c) life time
d) all of these
c) Programs
a) Access control
a) Local
d) Built-in
a) local scope
c) Modules
d) Modules
a) private
b) public
a) Data Encapsulation
c) protected
..19.. A. PRABHAKAR-9442979144
– 3. SCOPING
b) public
a) private
What is the lifetime of a variable?
..20.. A. PRABHAKAR-9442979144
4 ALGORITHMIC STRATEGIES
Part - I
Choose the best answer: 1 Mark
d) Selection sort
(Mar 2020, Jun 2023)
a) Algorithmic solution
(Mar 2024)
d) Big O
a) Big O
d) Half-interval search
Θ
b) Average case
a) Overlapping subproblems
c) Memoization
Part - II
Answer the following questions: 2 Marks
1. What is an Algorithm? (Mar 2020, Sep 2021)
..21.. A. PRABHAKAR-9442979144
– 4. ALGORITHMIC STRATEGIES
2. Write the phase of the performance evaluation of an algorithm. (PTA-5)
4. What is Sorting?
Example:
❖ ❖ ❖
5. What is searching? Write its types. (May 2022, Mar 2024)
Part - III
Answer the following questions: 3 Marks
1. List the characteristics of an algorithm. (Sep 2021, May 2022)
➢ Time Complexity:
➢ Space Complexity:
3. What are the factors that influence time and space complexity.
[ / What are the factors that measure the execution time of an algorithm? (PTA-6) ]
(PTA-6)
✓
✓
..22.. A. PRABHAKAR-9442979144
– 4. ALGORITHMIC STRATEGIES
✓
✓
✓
4. Write a note on Asymptotic notation. (Mar 2020, Jun 2023, Mar 2024)
→
→
→
5. What do you understand by Dynamic programming? (Sep 2020, Mar 2023)
➢
Part - IV
Answer the following questions: 5 Marks
1. Explain the characteristics of an algorithm. (PTA-5)
❖ Input:
❖ Output:
❖ Finiteness:
❖ Definiteness:
❖ Effectiveness:
❖ Correctness:
❖ Simplicity:
❖ Unambiguous:
❖ Feasibility:
❖ Portable:
❖ Independent:
..23.. A. PRABHAKAR-9442979144
– 4. ALGORITHMIC STRATEGIES
2. Discuss about Linear search algorithm. (Mar 2020, Jul 2022, Mar 2023, PTA-1)
Pseudo code:
✓
✓
3. What is Binary search? Discuss with example. (Sep 2021, Jun 2023, Mar 2024)
❖
❖
❖
✓
✓
..24.. A. PRABHAKAR-9442979144
– 4. ALGORITHMIC STRATEGIES
For example:
❖ 50 60.
1
❖ mid
high to mid - 1
❖
4. Explain the Bubble sort algorithm with example. (May 2022, PTA-6)
➢
..25.. A. PRABHAKAR-9442979144
– 4. ALGORITHMIC STRATEGIES
5. Explain the concept of Dynamic programming with suitable example. (Jul 2024)
❖
➢
Fibonacci Series – An example
..26.. A. PRABHAKAR-9442979144
– 4. ALGORITHMIC STRATEGIES
Fibonacci Iterative Algorithm with Dynamic programming approach
Step - 1:
Step - 2:
Step - 3:
Step - 4:
Step - 5: Step - 2
(SEP 2020)
d) Selection
(PTA-5)
d) Binary search
(PTA-1)
a) O(n) θ θ θ
(PTA-2)
d) Algorithm
(PTA-3)
b) Program
(PTA-4)
..27.. A. PRABHAKAR-9442979144
– 4. ALGORITHMIC STRATEGIES
if swapped == false:
break
Write the pseudo code for linear search. (PTA-4)
LinearSearch(array, target):
n = length(array)
for i from 0 to n-1:
if array[i] == target:
return i // element found at the index position
return -1 // element not found
Write the pseudo code for selection sort algorithm. (PTA-4)
SelectionSort(array):
n = length(array)
for i from 0 to n-1:
min_index = i
for j from i+1 to n-1:
if array[j] < array[min_index]:
min_index = j
if min_index != i:
swap(array[i], array[min_index])
b) Algorithm
d) Algorithmic strategy
c) Algorithmic solution
a) Average case
b) Best case
d) Sequential search
b) Binary search
..28.. A. PRABHAKAR-9442979144
– 4. ALGORITHMIC STRATEGIES
8. What is an algorithmic solution?
..29.. A. PRABHAKAR-9442979144
5 PYTHON – VARIABLES AND OPERATORS
Part - I
Choose the best answer: 1 Mark
(Jul 2024)
b) Guido Van Rossum
a) >>>
(Jul 22, Jun 23)
d) Ctrl + N
a) Interpreter
(Mar 2023)
d) operators
(May 2022, PTA-1)
b) Relational
d) Assignment
a) Ternary
Part - II
Answer the following questions: 2 Marks
1. What are the different modes that can be used to test Python Program? (Sep 21, May 22)
2. Write short notes on Tokens. (Sep 2020, Jun 2023, PTA-3, PTA-4)
..30.. A. PRABHAKAR-9442979144
– 5. VARIABLES AND OPERATORS
3. What are the different operators that can be used in Python? (Mar 2024, PTA-5, PTA-6)
❖ ❖
❖ ❖
❖
4. What is a literal? Explain the types of literals? (Jul 2024)
Part - III
Answer the following questions: 3 Marks
1. Write short notes on Arithmetic operator with examples. (Sep 2021, May 2022)
Assignment Operators:
Example:
→
3. Explain Ternary operator with examples. (Mar 2020, Mar 2023, PTA-1)
➢
..31.. A. PRABHAKAR-9442979144
– 5. VARIABLES AND OPERATORS
➢
Syntax:
Example:
Example:
Part - IV
Answer the following questions: 5 Marks
1. Describe in detail the procedure Script mode programming.
➢
➢
..32.. A. PRABHAKAR-9442979144
– 5. VARIABLES AND OPERATORS
Creating and Saving Scripts in Python
→
2. Explain input() and print() functions with examples. (Mar 2020, May 2022, Jun 2023,
Mar 2024, PTA-3)
input( ) function:
The syntax is
Example:
✓
✓
Example:
print() function:
..33.. A. PRABHAKAR-9442979144
– 5. VARIABLES AND OPERATORS
The syntax is
1” 2”’ 2)
Example:
✓
✓
3. Discuss in detail about Tokens in Python. (Sep 2021, Mar 2023, Jul 2024, PTA-3)
Tokens:
1) Identifiers:
➢
➢
➢
➢
➢
Example :
2) Keywords:
➢
..34.. A. PRABHAKAR-9442979144
– 5. VARIABLES AND OPERATORS
3) Operators:
➢
➢
➢
➢
Example : +, -, *, /, <, <=, …
4) Delimiters:
➢
5) Literals:
➢
➢
(Mar 2020)
(Sep 2021)
b) #
(Sep 2020, Mar 2024)
b) F5
(PTA-2)
a) 3
..35.. A. PRABHAKAR-9442979144
– 5. VARIABLES AND OPERATORS
(PTA-3)
b) 2
(PTA-4)
➢
➢
Example:
Example :
Example :
..36.. A. PRABHAKAR-9442979144
– 5. VARIABLES AND OPERATORS
List the key features of Python. (PTA-3)
✓
✓
✓
What are keywords? List some keywords. (PTA-1)
Explain the different types of operators used in Python. (Jul 2022, PTA-1)
Arithmetic operators:
..37.. A. PRABHAKAR-9442979144
– 5. VARIABLES AND OPERATORS
Logical operators:
➢
➢
➢ and, or not
Example:
✓
✓
Assignment operators:
➢
➢
Assignment Operators:
Example:
→
→
Conditional Operator:
➢
Syntax:
Example:
c) Netherland
b) 1991
) b) object ) )
..38.. A. PRABHAKAR-9442979144
– 5. VARIABLES AND OPERATORS
d) .py
b) strings
a) int()
c) Both a) and b)
a) Whitespace
a) 12Name
b) ==
a) =
c) 505
b) 10
b) 0o
b) 10.0
c) “Python”
..39.. A. PRABHAKAR-9442979144
– 5. VARIABLES AND OPERATORS
d) The Sum is : 30
d) 3
a) True
a) True
a) 20
c) 3.14
What is an Interactive mode Programming?
..40.. A. PRABHAKAR-9442979144
– 5. VARIABLES AND OPERATORS
Example:
❖
What are delimiters?
✓
✓
✓
✓
✓
Example of valid identifiers:
..41.. A. PRABHAKAR-9442979144
6 CONTROL STRUCTURES
Part - I
Choose the best answer: 1 Mark
(Mar 2023)
a) 3
(May 2022, Jun 2023)
c) else if
(Sep 2021)
d) Indentation
(Jul 2024)
c) pass
c) for
a) 12
b) True
(PTA-2, PTA-6)
a) for
b) :
..42.. A. PRABHAKAR-9442979144
– 6. CONTROL STRUCTURES
Part - II
Answer the following questions: 2 Marks
1. List the control structures in Python. (Jun 2023, PTA-6)
➢
Syntax:
5. Write note on range () in loop. (Mar 2020, Jul 2022, Mar 2023)
The syntax is
Example:
→
→
Part - III
Answer the following questions: 3 Marks
1. Write a program to display (Mar 2022, PTA-5)
A
AB
ABC
ABCD
ABCDE
..43.. A. PRABHAKAR-9442979144
– 6. CONTROL STRUCTURES
Program:
Syntax:
Example:
Output:
3. Using if.. elif.. else statement, write a suitable program to display largest of 3
numbers. (Mar 2024)
..44.. A. PRABHAKAR-9442979144
– 6. CONTROL STRUCTURES
4. Write the syntax of while loop. (Jul 2022, Mar 2023, Jul 2024, PTA-2, PTA-4)
5. List the differences between break and continue statements. (Mar 2022)
➢
Part - IV
Answer the following questions: 5 Marks
1. Write a detail note on for loop. (Sep 2021, May 2022, Jul 2022, Jul 2024)
Syntax:
Example:
Output:
..45.. A. PRABHAKAR-9442979144
– 6. CONTROL STRUCTURES
❖
Output:
2. Write a detail note on if.. elif.. else statement with suitable example. (PTA-3) /
Write the syntax of Nested if..elif...else statement with example. (Sep 2020)
Syntax:
Example:
Output:
..46.. A. PRABHAKAR-9442979144
– 6. CONTROL STRUCTURES
3. Write a program to display all 3-digit odd numbers. (Mar 2020)
(Mar 2020)
c) 2 4 6 8
(Sep 2020)
b) continue
(Jul 2022)
c) for
(Mar 2024)
a) 0 1 3 4
(PTA-1)
a) 1 3 5 7 9
(PTA-3)
c) 000000
16. (PTA-5)
c) step
..47.. A. PRABHAKAR-9442979144
– 6. CONTROL STRUCTURES
(PTA-4)
Write the output for the following Python programs. (Sep 2020)
Output:
Output:
(i) Write a program to display all 3 digit even numbers. (Mar 2020)
(ii) Write the output for the following program.
i=1
while(i<=6):
for j in range(1, i):
print(j,end="\t)
print(end="\n)
i+=1
..48.. A. PRABHAKAR-9442979144
– 6. CONTROL STRUCTURES
(i)
(ii) Output:
➢
break:
➢
➢
Syntax:
Example: Output:
..49.. A. PRABHAKAR-9442979144
– 6. CONTROL STRUCTURES
continue:
Syntax:
continue
Example: Output:
pass:
✓
✓
✓
Syntax:
Example: Output:
Syntax:
while <condition>:
statements block 1
[else:
statements block2]
statements block1 else
Example:
..50.. A. PRABHAKAR-9442979144
– 6. CONTROL STRUCTURES
Output:
) Control statements
d) while
a) break
c) pass
c) pass
c) 10 12 14
d) 29
a) 0
a) 10 11 12 13 14 15 16
..51.. A. PRABHAKAR-9442979144
– 6. CONTROL STRUCTURES
b) 2 4 6 8
c) Comput
a) Computr Scinc
d) 1 2 3 4
14. What is Sequential Statement? Give Example.
Example:
..52.. A. PRABHAKAR-9442979144
– 6. CONTROL STRUCTURES
16. Write short note on simple if statement.
Syntax:
if <condition>:
statements-block1
Example: Output:
❖
18. What is Nested loop structure?
19. What is the use of end and sep parameters in print() function?
➢ end
➢ sep
..53.. A. PRABHAKAR-9442979144
7 PYTHON FUNCTIONS
Part - I
Choose the best answer: 1 Mark
c) Function
(Mar 2023)
b) Recursion
(May 2022, Jul 2023, Jul 2024,
PTA-1)
a) Lambda
(Sep 2020)
d) def
(Sep 2021, Jul 2022)
b) return
c) : (colon)
a) Required
(Mar 2024)
b) x%4==0
(PTA-3)
c) def
Part - II
Answer the following questions: 2 Marks
1. What is function?
..54.. A. PRABHAKAR-9442979144
– 7. PYTHON FUNCTIONS
3. What are the main advantages of function? (Sep 2020, Jun 2023)
➢
➢
4. What is meant by scope of variable? Mention its types. (Jul 2022)
7. How to set the limit for recursive function? Give an example. (PTA-5)
➢
➢
Part - III
Answer the following questions: 3 Marks
1. Write the rules of local variable. (Mar 2022)
❖
❖
❖
❖
2. Write the basic rules for global keyword in python. (Jul 2022, Jul 2024, PTA-4)
❖
❖
❖
3. What happens when we modify global variable inside the function?
❖ “Unbound Local
Error
❖
..55.. A. PRABHAKAR-9442979144
– 7. PYTHON FUNCTIONS
4. Differentiate ceil() and floor() function? (Mar 2023, PTA-2)
floor(x) ceil (x)
Example: Example:
→ →
5. Write a Python code to check whether a given year is leap year or not. (Jun 2023)
composition
Example :
❖
❖ “return [expression]”
..56.. A. PRABHAKAR-9442979144
– 7. PYTHON FUNCTIONS
Part - IV
Answer the following questions: 5 Marks
1. Explain the different types of function with an example. (Jul 2022, PTA-3)
1) User-defined Functions:
Syntax:
Example: Output:
2) Built-in Functions:
➢
➢
➢
3) Lambda or Anonymous Functions: (PTA-2)
➢
➢ def
lambda
lambda
Syntax:
lambda [argument(s)] : expression
Example: Output:
✓ arg1 arg2
4) Recursion Functions:
➢
Example: Output:
..57.. A. PRABHAKAR-9442979144
– 7. PYTHON FUNCTIONS
2. Explain the scope of variables with an example. (Sep 2021, Jun 2023, Mar 2024, PTA-3)
❖
❖
Local Scope:
❖
❖
❖
Example:
Output:
Global Scope:
❖
❖
Example:
→ global variable
Output:
..58.. A. PRABHAKAR-9442979144
– 7. PYTHON FUNCTIONS
3. Explain the following built-in functions. (Mar 2020, Mar 2023, PTA-4, PTA-6)
a) id() b) chr() c) round() d) type() e) pow()
a) id() :
Syntax:
Example: Output:
b) chr() :
Syntax:
Example: Output:
c) round()
Syntax:
Example: Output:
d) type() :
Syntax:
Example: Output:
(e) pow() :
Syntax:
..59.. A. PRABHAKAR-9442979144
– 7. PYTHON FUNCTIONS
Example: Output:
5. Explain recursive function with an example. (Mar 2020, Jul 2024, PTA-5)
➢
➢
Example: Output:
..60.. A. PRABHAKAR-9442979144
– 7. PYTHON FUNCTIONS
Example:
(Mar 2020)
b) 14
(PTA-2)
b)
(PTA-4)
c) Tuples
(PTA-5)
d) Error
(PTA-6)
(ii) min():
..61.. A. PRABHAKAR-9442979144
– 7. PYTHON FUNCTIONS
Debug the following Python program to get the given output : (Sep 2020)
Output: Correct Program:
Program:
List the different types of arguments and explain with suitable examples. (PTA-4)
1. Required Arguments:
➢ Required Arguments
..62.. A. PRABHAKAR-9442979144
– 7. PYTHON FUNCTIONS
Example:
def
2. Keyword Arguments:
➢
Example:
3. Default Arguments:
➢
Example:
..63.. A. PRABHAKAR-9442979144
– 7. PYTHON FUNCTIONS
4. Variable-Length Arguments:
➢
➢
Example:
a) Function
d) 4
d) 4
d) return
a) Parameters
b) Arguments
a) Keyword arguments
..64.. A. PRABHAKAR-9442979144
– 7. PYTHON FUNCTIONS
c) Default argument
a) Keyword arguments
d) Error
c) None
a) hello – Python
None
d) Error
a) 30
..65.. A. PRABHAKAR-9442979144
– 7. PYTHON FUNCTIONS
d) 60
20
d) Error
a) 1000
c) lambda
b) global
c) 5
5
b) -18
c) 30
..66.. A. PRABHAKAR-9442979144
– 7. PYTHON FUNCTIONS
d) 10
5
24. What is a block?
Syntax:
return [expression list]
..67.. A. PRABHAKAR-9442979144
– 7. PYTHON FUNCTIONS
➢
Example:
Output 1: Output 2:
..68.. A. PRABHAKAR-9442979144
8 STRINGS AND STRING MANIPULATION
Part - I
Choose the best answer: 1 Mark
d) udaNlimaT
(May 2022)
c) Type error
(Mar 2023, Jul 2024)
a) +
b) Multiline Strings
(Sep 2021)
c) Immutable
(Mar 2024, PTA-1)
b) [ ]
(Jul 2022, PTA-2)
(PTA-5)
b) %E
d) either a) or b)
Part - II
Answer the following questions: 2 Marks
1. What is String? (Sep 2021, Jul 2024)
..69.. A. PRABHAKAR-9442979144
– 8. STRINGS AND STRING MANIPULATION
Example:
(i) (ii) (iii)
2. Do you modify a string in Python?
del
Example:
4. What will be the output of the following python code? (Jul 2022, PTA-1)
Output:
Part - III
Answer the following questions: 3 Marks
1. Write a Python program to display the given pattern. (Mar 2023)
Program:
str="COMPUTER"
i = len(str)
while (i > 0):
print(str[:i])
Example:
Tamilnadu
..70.. A. PRABHAKAR-9442979144
– 8. STRINGS AND STRING MANIPULATION
b) swapcase( )
Example:
TAMIL nadu
3. What will be the output of the given python program?
Output:
Example:
Output:
Syntax:
Example:
..71.. A. PRABHAKAR-9442979144
– 8. STRINGS AND STRING MANIPULATION
Part - IV
Answer the following questions: 5 Marks
1. Explain about string operators in python with suitable example. (Jun 2023, Jul 2024,
PTA-2)
(i) Concatenation (+):
Example:
welcome to Python
(ii) Append (+=):
Example:
Example:
Welcome Welcome Welcome Welcome
(iv) String slicing:
➢
➢
Syntax:
str[start:end]
✓ start end
Example:
T
..72.. A. PRABHAKAR-9442979144
– 8. STRINGS AND STRING MANIPULATION
THIRU
(v) Stride when slicing string: (PTA-6)
Example:
learn
er
(Mar 2020)
Answer : Error
(Sep 2020)
c) *
(PTA-3)
c) del
(PTA-6)
d) CMUE
What will be the output of the given Python program? (Mar 2020)
str="COMPUTER SCIENCE”
a) print(str*2)
b) print(str[0 : 7])
..73.. A. PRABHAKAR-9442979144
– 8. STRINGS AND STRING MANIPULATION
Syntax:
replace(“char1”, “char2”)
✓
Example:
isalpha()
isdigit()
islower()
isupper()
title()
..74.. A. PRABHAKAR-9442979144
– 8. STRINGS AND STRING MANIPULATION
Write the output for the following Python commands: (Mar 2020)
str1="Welcome to Python"
(i) print(str1) (ii) print(str1[11 : 17]) (iii) print(str1[11 : 17 : 2])
(iv) print(str1[: : 4]) (v) print(str1[: : —4])
Syntax:
Example:
Output:
Example: Output 1:
Output 2:
Example:
Output:
..75.. A. PRABHAKAR-9442979144
– 8. STRINGS AND STRING MANIPULATION
What will be output of the following Python snippet? (PTA-4)
Output:
Output:
✓
✓
Syntax:
Example:
=
)
output:
What is the positive and negative subscript value of the character 'h' in string 'school'?
(PTA-5)
How index value allocated to each character of a string in Python? (PTA-5)
/ How will you access characters in a string?
➢
➢
..76.. A. PRABHAKAR-9442979144
– 8. STRINGS AND STRING MANIPULATION
➢
Example:
Syntax:
Example:
Output:
c) String
d) Subscript
a) 0
a) 0 c) -1
b) +=
a) %
a) len(str)
a) count()
..77.. A. PRABHAKAR-9442979144
– 8. STRINGS AND STRING MANIPULATION
c) replace()
c) h
b) o
b) Compu
str=”Cat”
str[0]=”B”
print(str)
d) Error
c) third
str1=”Welcome”
print(str1.center(15,’*’))
c) ****Welcome****
17. What is the use of len() function? Give an example.
Example:
..78.. A. PRABHAKAR-9442979144
– 8. STRINGS AND STRING MANIPULATION
18. Compare ord( ) and chr() functions.
ord(char ) chr(ASCII)
• •
• Example: • Example:
65
19. Write short note on escape sequences in Python.
➢
➢
➢
Escape Sequence Description
..79.. A. PRABHAKAR-9442979144
9 LISTS, TUPLES, SETS AND DICTIONARY
Part - I
Choose the best answer: 1 Mark
(Jun 2023)
d) Loop
b) 8
c) len()
(Mar 2024)
c) [10,20,35,40,50]
(May 2022, PTA-1)
b) [17,23,41,10,32]
c) extend()
(Jul 2022)
b) [0,1,4,9,16]
(Jul 2024)
d) {1,3,6,9}
..80.. A. PRABHAKAR-9442979144
– 9. LISTS, TUPLES, SETS AND DICTIONARY
a) Symmetric difference
(Mar 2020)
d) :
Part - II
Answer the following questions: 2 Marks
1. What is List in Python? (Sep 2021)
“sequence data type”
Example: Output:
The value of x is 4
4. Differentiate del with remove() function of List.
➢
➢
Example:
or
5. Write the syntax of creating a Tuple with n number of elements. (Mar 2022)
..81.. A. PRABHAKAR-9442979144
– 9. LISTS, TUPLES, SETS AND DICTIONARY
6. What is set in Python? (Jul 2022, Jun 2023, PTA-4)
Part - III
Answer the following questions: 3 Marks
1. What are the difference between list and of Tuples ot?
List Tuples
Syntax:
✓
✓
Example: Output:
Output:
4. Explain the difference between del and clear() in dictionary with an example.
➢
➢
➢
Example: Output:
del Dict['Mark1']
NameError: name 'Dict' is not defined
..82.. A. PRABHAKAR-9442979144
– 9. LISTS, TUPLES, SETS AND DICTIONARY
Dict.clear()
del Dict
6. What are the differences between List and Dictionary? (Jun 2023, PTA-3)
List Dictionary
Part - IV
Answer the following questions: 5 Marks
1. What the different ways to insert an element in a list. Explain with suitable example.
(Jun 2023)
(i) append():
Syntax:
List.append(element to be added)
Example:
..83.. A. PRABHAKAR-9442979144
– 9. LISTS, TUPLES, SETS AND DICTIONARY
(ii) extend():
Syntax:
List.extend([elements to be added])
Example:
(iii) insert():
Syntax:
List.insert (position index, element)
Example:
2. What is the purpose of range( )? Explain with an example. (Sep 2021, Jul 2022, Mar 2024,
PTA-2)
i. Syntax:
✓ start value
✓ end value
✓ step value
Example: Output:
..84.. A. PRABHAKAR-9442979144
– 9. LISTS, TUPLES, SETS AND DICTIONARY
Syntax:
Example:
3. What is nested tuple? Explain with an example. (Jul 2022, Mar 2023)
➢
➢
➢
Example:
Output:
4. Explain the different set operations supported by python with suitable example.
(Mar 2020, Sep 2020, May 2022, Jul 2024, PTA-1)
(i) Union:
➢
➢ | union( )
Example: Output:
(OR)
(ii) Intersection:
➢
➢ & intersection( )
..85.. A. PRABHAKAR-9442979144
– 9. LISTS, TUPLES, SETS AND DICTIONARY
Example: Output:
(OR)
(iii) Difference:
➢
➢ (-) difference( )
Example: Output:
(OR)
(iv) Symmetric difference: (PTA-3)
➢
➢ (^) symmetric_difference()
Example: Output:
(OR)
(SEP 2020)
d) 80
(Sep 2021)
b) 23
(SEP 2021)
d) 8
(PTA-3)
c) len()
(PTA-4)
b) range()
..86.. A. PRABHAKAR-9442979144
– 9. LISTS, TUPLES, SETS AND DICTIONARY
(PTA-5)
c) Set
(PTA-6)
c) 5
How will you create a list in python? (Sep 2020)
Syntax:
Example:
➢
Write execution table for the following Python code. (PTA-1)
Execution table
..87.. A. PRABHAKAR-9442979144
– 9. LISTS, TUPLES, SETS AND DICTIONARY
Output:
What will be the output of the following Python program? (PTA-2, PTA-5)
Output:
Output:
Output:
Output:
..88.. A. PRABHAKAR-9442979144
– 9. LISTS, TUPLES, SETS AND DICTIONARY
Write a simple python program with list of five marks and print the sum of all the
marks using while loop. (PTA-5)
Output:
c) List
a) Tuples
d) Dictionary
d) Set
c) 5
..89.. A. PRABHAKAR-9442979144
– 9. LISTS, TUPLES, SETS AND DICTIONARY
b) [2,4,6,8,10]
c) [1,4,9,16,25,36,49,64,81,100]
print(x)
b) 1
c) Dictionary
c) Error
b) {1:2,2:4,3:6}
) -2
b) 3
b) type()
a) tup=(10,)
b) clear()
19. Write short note on List comprehension.
..90.. A. PRABHAKAR-9442979144
– 9. LISTS, TUPLES, SETS AND DICTIONARY
Syntax:
Example:
Output:
Example:
21. How can you access all the list elements using for loop?
Syntax:
✓
Example: Output:
Example:
Syntax:
..91.. A. PRABHAKAR-9442979144
– 9. LISTS, TUPLES, SETS AND DICTIONARY
Example: Output:
Example:
➢
26. Write the output of this statement.
..92.. A. PRABHAKAR-9442979144
10 PYTHON CLASSES AND OBJECTS
Part - I
Choose the best answer: 1 Mark
d) __init__( )
(Jul 2024)
a) __
(May 2022, PTA-1)
d) __del__( )
(Sep 2021, PTA-6)
c) class class_name:
b) Tamil
(PTA-2)
a) __num
(Sep 2021, Jun 2023, Mar 2024)
d) Instantiation
Part - II
Answer the following questions: 2 Marks
1. What is class? (Mar 2023, Jul 2024, PTA-1)
..93.. A. PRABHAKAR-9442979144
– 10. PYTHON CLASSES AND OBJECTS
2. What is instantiation? (PTA-6)
Output:
➢
Syntax:
Example:
Output:
..94.. A. PRABHAKAR-9442979144
– 10. PYTHON CLASSES AND OBJECTS
Example:
→
→
2. Write a class with two private class variables and print the sum using a method.
Program: (PTA-2)
3. Find the error in the following program to get the given output?
Output:
Error:
4. What is the output of the following program? (Mar 2020, Jul 2022)
..95.. A. PRABHAKAR-9442979144
– 10. PYTHON CLASSES AND OBJECTS
Output:
5. How do define constructor and destructor in Python? (Mar 2020, Mar 2024, PTA-4)
Syntax of Constructor:
Syntax of Destructor:
Example: Output:
Part - IV
Answer the following questions: 5 Marks
1. Explain about constructor and destructor with suitable example. (Sep 2020)
Constructor:
Syntax:
Example:
..96.. A. PRABHAKAR-9442979144
– 10. PYTHON CLASSES AND OBJECTS
✓
Syntax:
Example:
(PTA-2)
b) self
(PTA-5)
d) Creating an object
Find the output of the following Python code. (PTA-1)
..97.. A. PRABHAKAR-9442979144
– 10. PYTHON CLASSES AND OBJECTS
Output:
What is the use of private and public data members? (Sep 2020, PTA-3)
➢
..98.. A. PRABHAKAR-9442979144
– 10. PYTHON CLASSES AND OBJECTS
Output:
Rewrite the following Python program to get the given output: (PTA-3)
..99.. A. PRABHAKAR-9442979144
– 10. PYTHON CLASSES AND OBJECTS
a) C
c) a) and b)
b) Object
b) Public
d) Dot(.)
d) _ _init_ _
c) Constructor
c) class
c) Colon(:)
a) Private
..100.. A. PRABHAKAR-9442979144
– 10. PYTHON CLASSES AND OBJECTS
a) Private
b) Public
a) indented
d) Destructor
15. How would you define a class in Python?
Syntax:
Exmple:
Syntax:
Example:
✓ ‘S’
..101.. A. PRABHAKAR-9442979144
– 10. PYTHON CLASSES AND OBJECTS
17. How will you access class members?
Syntax:
Example:
Output:
self
➢
..102.. A. PRABHAKAR-9442979144
11 DATABASE CONCEPTS
Part - I
Choose the best answer: 1 Mark
(Sep 2021)
c) Microsoft Access
(Mar 2020, Mar 2024, PTA-2)
a) σ Π
(May 2022, PTA-6)
b) row
a) Chen
Part - II
Answer the following questions: 2 Marks
1. Mention few examples of a database. (Jul 2022)
2. List some examples of RDBMS.
..103.. A. PRABHAKAR-9442979144
– 11. DATABASE CONCEPTS
3. What is data consistency? (Jun 2023)
❖
❖
4. What is the difference between Hierarchical and Network data model? (Mar 2024)
❖
❖
❖
5. What is normalization?
Part - III
Answer the following questions: 3 Marks
1. What is the difference between Select and Project command? (PTA-2)
Select Project
symbol : σ symbol : ∏
2. What is the role of DBA? (Jun 2023)
➢
❖
Table A Table B
RollNo Name SubCode Subject
..104.. A. PRABHAKAR-9442979144
– 11. DATABASE CONCEPTS
Cartesian product : Table A x Table B
RollNo Name SubCode Subject
❖
❖
5. Write a note on different types of DBMS users. (Sep 2020)
➢ Database Administrators:
➢ End User:
➢ Database designers:
Part - IV
Answer the following questions: 5 Marks
1. Explain the different types of data model. (Sep 2020)
1. Hierarchical Model:
➢
..105.. A. PRABHAKAR-9442979144
– 11. DATABASE CONCEPTS
➢
➢
2. Relational Model:
➢
➢
➢
➢
➢
Parent
Node
..106.. A. PRABHAKAR-9442979144
– 11. DATABASE CONCEPTS
4. Entity Relationship Model (ER model):
➢
➢
➢
➢
➢
✓
5. Object Model:
➢
➢
➢
Example:
Shape
..107.. A. PRABHAKAR-9442979144
– 11. DATABASE CONCEPTS
✓
✓
✓
✓
2. Explain the different types of relationship mapping. (Mar 2023, PTA-1, PTA-4)
1. One-to-One Relationship: Student Exam No
➢
For example:
For example:
3. Many-to-One Relationship:
Staff Department
➢
For example:
..108.. A. PRABHAKAR-9442979144
– 11. DATABASE CONCEPTS
4. Many-to-Many Relationship:
Book Student
➢
For example:
3. Differentiate DBMS and RDBMS. (Mar 2020, Mar 2023, Jul 2024)
Basis of
DBMS RDBMS
Comparison
Expansion
Data storage
Data redundancy
Normalization
Data access
Transaction
Distributed
Example
..109.. A. PRABHAKAR-9442979144
– 11. DATABASE CONCEPTS
➢
PROJECT (symbol : Π)
➢
Π
Result
Table A Table B
Studno Name Studno Name
..110.. A. PRABHAKAR-9442979144
– 11. DATABASE CONCEPTS
UNION (Symbol :∪)
➢
➢ ∪
Result
Table A ∪ B
Studno Name
Result
Table A B
Studno Name
INTERSECTION (symbol: ∩) A ∩ B
➢
Result
∩
Studno Name
..111.. A. PRABHAKAR-9442979144
– 11. DATABASE CONCEPTS
Table A Table B
RollNo Name SubCode Subject
5. Explain the characteristics of RDBMS. (Sep 2021, Jul 2022, Jun 2023, PTA-3, PTA-5)
1. Ability to manipulate
data
2. Reduced Redundancy
3. Data Consistency
5. Query Language
6. Security
7. DBMS Supports
(PTA-1)
a) Attribute
(PTA-3)
d) All of these
(PTA-5)
b) ᓂ
..112.. A. PRABHAKAR-9442979144
– 11. DATABASE CONCEPTS
What are the advantages of RDBMS? (Sep 2020, Sep 2021, PTA-3)
➢
➢
➢
➢
What are the shapes to represent database structures in ER model? (PTA-2)
❖
❖
❖
Write about Database Structure. (PTA-6)
➢
o
o
o
d) Data
a) Information
b) 5
..113.. A. PRABHAKAR-9442979144
– 11. DATABASE CONCEPTS
b) Tuple
b) IBM
a) Hierarchical Model
b) 1970
d) 1976
a) Rectangle
b) Ellipse
c) Diamond
a) Hierarchical Model
a) One-to-One
a) One-to-One Relationship
d) Many-to-Many Relationship
..114.. A. PRABHAKAR-9442979144
– 11. DATABASE CONCEPTS
α c) X
19. What is Data?
Example:
Example:
➢
➢
23. What is Data Model?
❖
❖
❖
..115.. A. PRABHAKAR-9442979144
– 11. DATABASE CONCEPTS
25. Explain the components of DBMS.
1. Hardware:
2. Software:
3. Data:
4. Procedures/Methods:
..116.. A. PRABHAKAR-9442979144
12 STRUCTURED QUERY LANGUAGE
Part - I
Choose the best answer: 1 Mark
a) DDL
d) ALTER
(Mar 2020, Jul 2022, Mar 2023)
a) DROP
(Jul 2024)
a) SELECT
(Sep 2021, May 2022, Jun 2023, Mar 2024)
b) ORDER BY
Part - II
Answer the following questions: 2 Marks
1. Write a query that selects all students whose age is less than 18 in order wise.
2. Differentiate Unique and Primary Key constraint. (Mar 2022, Jul 2024, PTA-6)
Unique Constraint Primary Key Constraint
3. Write the difference between table constraint and column constraint? (Jun 2023)
➢ Table constraint
➢ Column constraint:
4. Which component of SQL lets insert values in tables and which lets to create a table?
➢ DDL (Data Definition Language)
➢ DML (Data Manipulation Language)
5. What is the difference between SQL and MySQL? (PTA-5)
❖ SQL :
❖ MySQL :
..117.. A. PRABHAKAR-9442979144
– 12. STRUCTURED QUERY LANGUAGE
Part - III
Answer the following questions: 3 Marks
1. What is a constraint? Write short note on Primary key constraint.
2. Write a SQL statement to modify the student table structure by adding a new field.
Syntax:
Example:
..118.. A. PRABHAKAR-9442979144
– 12. STRUCTURED QUERY LANGUAGE
Place
Part - IV
Answer the following questions: 5 Marks
1. Write the different types of constraints and their functions. (Sep 2020, Sep 2021,
Jul 2022, PTA-3)
..119.. A. PRABHAKAR-9442979144
– 12. STRUCTURED QUERY LANGUAGE
→
→
→
..120.. A. PRABHAKAR-9442979144
– 12. STRUCTURED QUERY LANGUAGE
2. Consider the following employee table. Write SQL commands for the questions. (i) to
(v). (PTA-2)
3. What are the components of SQL? Write the commands in each. (Mar 2024)
..121.. A. PRABHAKAR-9442979144
– 12. STRUCTURED QUERY LANGUAGE
➢ Drop:
➢ Truncate:
➢ Select:
..122.. A. PRABHAKAR-9442979144
– 12. STRUCTURED QUERY LANGUAGE
4. Construct the following SQL statements in the student table. (Sep 2020, May 2022)
(i) SELECT statement using GROUP BY clause.
(ii) SELECT statement using ORDER BY clause.
5. Write a SQL statement to create a table for employee having any five fields and create
a table constraint for the employee table. (Mar 2020)
(Sep 2020)
b) Grant
(PTA-1)
d) Revoke
(PTA-2)
d) TRUNCATE
(PTA-3)
d) Rollback
..123.. A. PRABHAKAR-9442979144
– 12. STRUCTURED QUERY LANGUAGE
(PTA-4)
a) DDL
(PTA-5)
(PTA-6)
b) UPDATE
What are DCL commands in SQL? (PTA-4)
Example:
..124.. A. PRABHAKAR-9442979144
– 12. STRUCTURED QUERY LANGUAGE
(3) UPDATE command:
❖
❖ Example:
TRUNCATE:
DROP:
Commit :
Roll back :
Save point :
..125.. A. PRABHAKAR-9442979144
– 12. STRUCTURED QUERY LANGUAGE
Gowri
Gowri
Gowri
Gowri
What are the functions performed by DDL? (PTA-6)
..126.. A. PRABHAKAR-9442979144
– 12. STRUCTURED QUERY LANGUAGE
) ) c) Sequel )
d) 2008
c) Constraint
a) Check
b) Default
b) ALL
A) DELETE
c) TRUNCATE
c) DESC
13. What is SQL?
➢
..127.. A. PRABHAKAR-9442979144
– 12. STRUCTURED QUERY LANGUAGE
➢
❖ Keywords
❖ Commands
❖ Clauses
❖ Arguments
20. Write the different types of constraints.
..128.. A. PRABHAKAR-9442979144
– 12. STRUCTURED QUERY LANGUAGE
21. What is the use of default constraint?
➢
➢
Example:
Example:
Syntax: Syntax:
..129.. A. PRABHAKAR-9442979144
– 12. STRUCTURED QUERY LANGUAGE
Syntax:
Example:
(1)
SELECT Admno, Name, Age FROM Student WHERE Age BETWEEN 18 AND 19;
➢
SELECT Admno, Name, Age FROM Student WHERE Age NOT BETWEEN 18 AND 19;
26. Write about the keywords IN and NOT IN?
➢
For Example:
SELECT Admno, Name, Place FROM Student WHERE Place IN (‘Chennai’, ‘Delhi’);
➢
For example:
SELECT Admno, Name, Place FROM Student WHERE Place NOT IN (‘Chennai’, ‘Delhi’);
✓
27. How can you search a NULL value field?
➢
..130.. A. PRABHAKAR-9442979144
– 12. STRUCTURED QUERY LANGUAGE
28. Explain the processing skills of SQL.
1. Data Definition Language (DDL):
4. View Definition:
5. Authorization:
6. Integrity:
7. Transaction control:
..131.. A. PRABHAKAR-9442979144
– 12. STRUCTURED QUERY LANGUAGE
30. Explain the use of ALTER command.
Example:
✓
Example:
For example,
For example,
..132.. A. PRABHAKAR-9442979144
13 PYTHON AND CSV FILES
Part - I
Choose the best answer: 1 Mark
(Mar 2020, Mar 2024)
a) Flat File
(May 2022, Jul 2024)
c) csv
a) Line Terminator
b) mumbai,andheri
(PTA-1)
d) DictReader()
c) Modification
..133.. A. PRABHAKAR-9442979144
– 13. PYTHON AND CSV FILES
d) Exam,
Quarterly,
Halfyearly
Part - II
Answer the following questions: 2 Marks
1. What is CSV File? (Sep 2021, May 2022, Mar 2024)
2. Mention the two ways to read a CSV file using Python. (Sep 2020, PTA-2)
5. How will you sort more than one column from a csv file? Give an example statement.
Example:
..134.. A. PRABHAKAR-9442979144
– 13. PYTHON AND CSV FILES
Output:
Part - III
Answer the following questions: 3 Marks
1. Write a note on open() function of python. What is the difference between the two
methods? (Jul 2022, PTA-1)
Python has a built-in function open() to open a file. file object,
handle,
The open() method is not entirely safe. If an exception occurs when you are performing
some operation with the file, the code exits without closing the file.
But “with open” statement ensures that the file is closed when the block inside with is
exited.
2. Write a Python program to modify an existing file. (Jul 2022)
..135.. A. PRABHAKAR-9442979144
– 13. PYTHON AND CSV FILES
When we open the student.csv file with text editor, then it will show:
Roll No Name City
3. Write a Python program to read a CSV file with default delimiter comma (,).
4. What is the difference between the write mode and append mode.
(Sep 2021, PTA-2, PTA-5)
‘w’ - write mode:
5. What is the difference between reader() method and DictReader() class? (Mar 2020)
reader() DictReader()
..136.. A. PRABHAKAR-9442979144
– 13. PYTHON AND CSV FILES
Part - IV
Answer the following questions: 5 Marks
1. Differentiate Excel file and CSV file. (Sep 2020, May 2022, Jul 2024, PTA-2)
Excel CSV
3. Write the different methods to read a File in Python. (Jul 2022, Jun 2023, Mar 2024)
..137.. A. PRABHAKAR-9442979144
– 13. PYTHON AND CSV FILES
➢
✓ file object:
✓ delimiter:
✓ fmtparams:
Example:
Example:
..138.. A. PRABHAKAR-9442979144
– 13. PYTHON AND CSV FILES
5. Write the rules to be followed to format the data in a CSV file. (PTA-5)
xxx,yyy
ppp, qqq
yyy, xxx
field_name1,field_name2,field_name3
aaa,bbb,ccc
zzz,yyy,xxx CRLF
Red , Blue
"Red","Blue","Green"
Black,White,Yellow
(Sep 2020)
..139.. A. PRABHAKAR-9442979144
– 13. PYTHON AND CSV FILES
(PTA-4)
b) skipinitialspace
(PTA-5)
b) DictReader
How csv.writer() function is used to create a normal CSV file in Python? (PTA-4)
✓ fileobject :
✓ delimiter :
✓ fmtparams :
1.
b) EXCEL ) )
2.
) b) double-quote(“)
) )
3.
c) rt
4.
a) a
5.
d) b
6.
d) +
..140.. A. PRABHAKAR-9442979144
– 13. PYTHON AND CSV FILES
7.
) ) ) d) close()
8.
b) dialect
9.
) b) writerow() ) )
10.
) ) ) d) writerows()
11.
d) \n or \r
12. Write the purpose of CSV file.
➢ file
13. How will you create a new CSV file using Microsoft Excel?
❖
❖ →
..141.. A. PRABHAKAR-9442979144
14 IMPORTING C++ PROGRAMS IN PYTHON
Part - I
Choose the best answer: 1 Mark
(Sep 2020)
d) HTML
(Mar 2023)
a) Wrapping
(PTA-5)
b) Modular programming
a) main(sys.argv[1:])
d) PYTHON
(PTA-6)
c) python filename
..142.. A. PRABHAKAR-9442979144
– 14. IMPORTING C++ PROGRAMS IN PYTHON
Part - II
Answer the following questions: 2 Marks
1. What is the theoretical difference between Scripting language and other programming
language? (Sep 2021)
➢
➢
➢
➢
Part - III
Answer the following questions: 3 Marks
1. Differentiate PYTHON and C++. (Sep 2021, Jun 2023)
PYTHON C++
..143.. A. PRABHAKAR-9442979144
– 14. IMPORTING C++ PROGRAMS IN PYTHON
2. What are the applications of scripting language? (Sep 2020, Mar 2024, PTA-4)
4. Identify the module, operator, definition name for the following. (Jul 2022)
➢
➢
Part - IV
Answer the following questions: 5 Marks
1. Write any 5 features of Python. (Mar 2020, Jun 2023, Mar 2024)
❖
❖
❖
❖
❖
..144.. A. PRABHAKAR-9442979144
– 14. IMPORTING C++ PROGRAMS IN PYTHON
❖
✓
✓
✓
✓
sys argv
sys.argv:
➢
➢
➢
➢
Python's OS Module:
➢ OS
➢ OS
➢
compiler
os.system (‘g++ ’ + <variable_name1> ‘ -<mode> ’ + <variable_name2>
Python getopt module:
➢
➢
getopt.getopt function:
..145.. A. PRABHAKAR-9442979144
– 14. IMPORTING C++ PROGRAMS IN PYTHON
4. Write the syntax for getopt() and explain its arguments and return values. (Mar 2022,
Mar 2023, PTA-2, PTA-5)
Syntax:
<opts>,<args>=getopt.getopt(argv, options, [long_options])
the parameters:
✓ argv −
✓ options −
✓ long_options −
Python Program:
# Save the following python programs as “myprg.py”
..146.. A. PRABHAKAR-9442979144
– 14. IMPORTING C++ PROGRAMS IN PYTHON
(PTA-1)
b) __name__
(PTA-3)
a) pycpp.py рус
(PTA-4)
a) __name__
4. Write about the steps of Python program executing C++ program using control
statement. (Mar 2023)
Step 1 :
Step 2 :
Step 3 : .
Step 4 :
a) Python
b) SWIG
)
)
)
d) Simplified Wrapper Interface Generator
) )
c) Boost )
..147.. A. PRABHAKAR-9442979144
– 14. IMPORTING C++ PROGRAMS IN PYTHON
b) Ruby
c) cls
8.
a) import ) ) )
9. of the following is not a module in Python?
) ) c) argv )
c) argv
b) getopt
12. Write short note on Scripting Language.
➢
15. Name some of the commonly used interfaces to import C++ files in Python.
16. What is g++?
➢
..148.. A. PRABHAKAR-9442979144
– 14. IMPORTING C++ PROGRAMS IN PYTHON
➢
__name__ is one such special variable which by default stores the name of the file.
➢
➢
➢ __name__ is a built-in variable which evaluates to the name of the current module.
For example:
if __name__ == '__main__':
main (sys.argv[1:])
✓
..149.. A. PRABHAKAR-9442979144
15 DATA MANIPULATION THROUGH SQL
✓
Part - I
Choose the best answer: 1 Mark
(Mar 2020)
a) Database
(Sep 2021, May 2022)
b) Relational Database system
c) Cursor
c) Commit
a) execute()
c) AVG()
(Jul 2022, Mar 2023)
a) MAX()
(PTA-6)
a) sqlite_master
(Jun 2023, Mar 2024)
b) select
(Jul 2024, PTA-5)
a) Distinct
Part - II
Answer the following questions: 2 Marks
1. Mention the users who uses the Database.
..150.. A. PRABHAKAR-9442979144
– 15. DATA MANIPULATION THROUGH SQL
Example:
3. What is the advantage of declaring a column as “INTEGER PRIMARY KEY”? (Mar 2020)
✓
4. Write the command to populate record in a table. Give an example.
Example:
5. Which method is used to fetch all rows from the database table? (Jul 2022, Mar 2024)
➢
Example:
Part - III
Answer the following questions: 3 Marks
1. What is SQLite? What is it advantage? (PTA-1)
➢
Advantages:
➢
➢
➢
2. Mention the difference between fetchone() and fetchmany(). (Mar 2020, Jul 2022, Mar
2023, Jul 2024, PTA-4)
fetchone() fetchmany()
..151.. A. PRABHAKAR-9442979144
– 15. DATA MANIPULATION THROUGH SQL
3. What is the use of Where clause? Give a python statement using the where clause.
(May 2022, Mar 2024)
➢
Python script:
..152.. A. PRABHAKAR-9442979144
– 15. DATA MANIPULATION THROUGH SQL
5. Read the following details. Based on that write a python script to display records in
descending order of Eno
Python script:
Part - IV
Answer the following questions: 5 Marks
1. Write in brief about SQLite and the steps used to use it. (Jul 2022, Jun 2023)
➢
➢
➢
To use SQLite,
✓ Step 1 -
✓ Step 2 -
..153.. A. PRABHAKAR-9442979144
– 15. DATA MANIPULATION THROUGH SQL
✓ Step 3 -
Example:
2. Write the Python script to display all the records of the following table using
fetchmany(). (Sep 2021, PTA-1)
Python script:
3. What is the use of HAVING clause. Give an example python script. (PTA-5)
➢
➢
➢
Example:
..154.. A. PRABHAKAR-9442979144
– 15. DATA MANIPULATION THROUGH SQL
OUTPUT:
4. Write a Python script to create a table called ITEM with following specification.
Python script:
5. Consider the following table Supplier and item. Write a python script for (i) to (ii)
..155.. A. PRABHAKAR-9442979144
– 15. DATA MANIPULATION THROUGH SQL
Python script:
# i) Display Name, City and Itemname of suppliers who do not reside in Delhi.
(Sep 2020)
d) COUNT()
PTA-2)
c) execute
(PTA-3)
a) SELECT
(PTA-4)
c) cursor
Write a Python code to create a database in SQLite. (PTA-3)
✓
✓
..156.. A. PRABHAKAR-9442979144
– 15. DATA MANIPULATION THROUGH SQL
Write a Python program to store and retrieve the following data in SQLite3. (PTA-4)
..157.. A. PRABHAKAR-9442979144
– 15. DATA MANIPULATION THROUGH SQL
COUNT() :
Example:
Output:
AVG() :
Example:
..158.. A. PRABHAKAR-9442979144
– 15. DATA MANIPULATION THROUGH SQL
Output:
SUM() :
Example:
Output:
Output:
..159.. A. PRABHAKAR-9442979144
– 15. DATA MANIPULATION THROUGH SQL
Write a Python code to display all the records of the following table using fetchmany().
(PTA-1)
Python script:
c) fetchmany()
b) *
a) HAVING
b) WHERE
a) b) c) WHERE() d)
a) b) c) d) COUNT()
a) 1 b) 4 c) 3 d) 2
c) ? and :name
..160.. A. PRABHAKAR-9442979144
– 15. DATA MANIPULATION THROUGH SQL
b) “/” or “\”
What is the use of cursor object?
➢
List out various clauses in SQL?
Write short note on cursor.description().
➢
➢
➢
➢
What is Sqlite_master?
Example:
Output:
..161.. A. PRABHAKAR-9442979144
– 15. DATA MANIPULATION THROUGH SQL
➢
Example:
..162.. A. PRABHAKAR-9442979144
DATA VISUALIZATION USING PYTHON:
16
LINE CHART, PIE CHART AND BAR CHART
✓
Part - I
Choose the best answer: 1 Mark
a) matplotlib.pyplot
b) PIP
d) Data Visualization
(Mar 2024)
b) Dashboard
(Jul 2024)
d) matplotlib
..163.. A. PRABHAKAR-9442979144
– 16. DATA VISUALIZATION
a) Line chart
2. List the general types of data visualization. (Mar 2020, Jul 2022, Mar 2023, Jul 2024)
❖ ❖ ❖
❖ ❖ ❖
3. List the types of Visualizations in Matplotlib. (Sep 2020, Mar 2024)
❖ ❖ ❖
❖ ❖ ❖
4. How will you install Matplotlib?
✓
..164.. A. PRABHAKAR-9442979144
– 16. DATA VISUALIZATION
Part - III
Answer the following questions: 3 Marks
1. Draw the output for the following data visualization plot.
Output:
2. Write any three uses of data visualization. (May 2022, PTA-1, PTA-5)
❖
❖
❖
..165.. A. PRABHAKAR-9442979144
– 16. DATA VISUALIZATION
Code:
Part - IV
Answer the following questions: 5 Marks
1. Explain in detail the types of pyplots using Matplotlib. (PTA-6)
Line Chart:
➢
Example: Output:
Bar Chart:
➢
➢
➢
➢
➢
..166.. A. PRABHAKAR-9442979144
– 16. DATA VISUALIZATION
Example: Output:
Pie Chart:
➢
➢
➢
➢ plt.pie()
➢
Example: Output:
➢ Home Button:
➢ Forward/Back buttons:
➢ Pan Axis:
..167.. A. PRABHAKAR-9442979144
– 16. DATA VISUALIZATION
➢ Zoom:
➢ Configure Subplots:
➢ Save Figure:
3. Explain the purpose of the following functions: (May 2022)
a. plt.xlabel
b. plt.ylabel
c. plt.title
d. plt.legend()
e. plt.show()
(Sep 2021)
b) plt.show()
(PTA-1)
a) Matplotlib
(PTA-2)
d) plt.pie()
(PTA-3)
d) SQLite
(PTA-4)
c) Scatter plot
(PTA-5)
d) plot()
(PTA 6)
a) Markers
What is Matplotlib? (PTA-2)
What is pie chart? How will you create pie chart in Python? Give an example. (PTA-3)
❖
..168.. A. PRABHAKAR-9442979144
– 16. DATA VISUALIZATION
❖
Creating Pie chart:
❖ plt.pie()
❖
Example: Output:
Output:
..169.. A. PRABHAKAR-9442979144
– 16. DATA VISUALIZATION
What are the Key Differences Between Histogram and Bar Graph? (Sep 2021, Mar 2023,
PTA-4)
b) Data Visualization
b) Infographics
a) Dashboard
a) Bar chart
d) Histogram
b) Pan Axis
..170.. A. PRABHAKAR-9442979144
– 16. DATA VISUALIZATION
c) a) and b)
9. What is an Infographic?
..171.. A. PRABHAKAR-9442979144
PRACTICAL EXERCISES
1(a) Write a program to calculate the factorial of the given number using for loop (Don’t use built-
in function factorial).
PY1(a) – CALCULATE FACTORIAL
AIM:
Program to calculate the factorial of the given number using for loop.
CODING:
num = int(input('Enter a Number: '))
fact = 1
for i in range(1,num+1):
fact = fact * i
print("Factorial of ", num, " is ", fact)
OUTPUT:
Enter a Number: 6
Factorial of 6 is 720
CONCLUSION:
The factorial of the given number is calculated successfully using for loop.
..172.. A. PRABHAKAR-9442979144
– PRACTICAL EXERCISES
2(a). Write a program using functions to check whether a number is even or odd.
PY2(a) – ODD OR EVEN
AIM:
Program to check whether a number is even or odd using functions.
CODING:
def oddeven(a):
if (a%2==0):
return "Even"
else:
return "Odd"
num = int(input("Enter a number: "))
print("The given number is ", oddeven(num))
OUTPUT:
Enter a number : 5
The Given number is Odd
Enter a number : 8
The Given number is Even
CONCLUSION:
It was successfully verified whether the given number is even or odd.
2(b) Write a program to create reverse of the given string. For example, “wel” = “lew“. (Don’t use
string slice with stride operation)
PY2(b) – REVERSE THE STRING
AIM:
Program to create a mirror image of the given string.
CODING:
def reverse(str1):
str2=''
for i in str1:
str2 = i + str2
return str2
word = input("Enter a String: ")
print("The reverse of the given string is:", reverse(word))
OUTPUT:
Enter a String: School
The reverse of the given string is: loohcS
CONCLUSION:
The mirror image of the given string is displayed successfully.
..173.. A. PRABHAKAR-9442979144
– PRACTICAL EXERCISES
3. Write a program to generate values from 1 to 10 and then remove all the odd numbers from the
list.
PY3 - GENERATE VALUES AND REMOVE ODD NUMBERS
AIM:
Program to generate values from 1 to 10 and then remove all the odd numbers from the
list.
CODING:
num = list(range(1,11))
print("Numbers from 1 to 10.....\n",num)
for i in num:
if(i%2 == 1):
num.remove(i)
print("The values after removing odd numbers.....\n",num)
OUTPUT:
Numbers from 1 to 10.....
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
The values after removing odd numbers.....
[2, 4, 6, 8, 10]
CONCLUSION:
Generated values from 1 to 10 in a list and successfully removed all odd numbers.
4. Write a Program that generate a set of prime numbers and another set of odd numbers. Display
the result of union, intersection, difference and symmetric difference operations.
PY4 - GENERATE PRIME NUMBERS AND SET OPERATIONS
AIM:
Program to generate a set of prime numbers and another set of odd numbers and then
perform various set operations.
OUTPUT:
CODING:
Odd Number: {1, 3, 5, 7, 9}
odd = set(range (1,10,2))
Prime Number: {2, 3, 5, 7}
prime=set()
Union: {1, 2, 3, 5, 7, 9}
for i in range(2,10):
Intersection: {3, 5, 7}
for j in range (2,i):
Difference: {1, 9}
if (i%j==0):
Symmetric_Difference:{1,2,9}
break
CONCLUSION:
else:
The set of prime numbers
prime.add(i)
and odd numbers are generated
print("Odd Numbers:", odd)
and then performed various set
print("Prime Numbers:", prime) operations successfully.
print("Union:", odd.union(prime))
print("Intersection:", odd.intersection(prime))
print("Difference:", odd.difference(prime))
print("Symmetric Difference:", odd.symmetric_difference(prime))
..174.. A. PRABHAKAR-9442979144
– PRACTICAL EXERCISES
5. Write a program to accept a string and print the number of uppercase, lowercase, vowels,
consonants and spaces in the given string using Class.
PY5 - DISPLAY A STRING ELEMENTS – USING CLASS
AIM:
Program to accept a string and print the number of uppercase, lowercase, vowels,
consonants and spaces in the given string using Class.
CODING:
class String:
def __init__(self):
self.u = 0
self.l = 0
self.v = 0
self.c = 0
self.b = 0
self.str = ''
def getstr(self):
self.str = input("Enter a String : ")
for ch in self.str:
if (ch.isupper()):
self.u += 1
if (ch.islower()):
self.l += 1
if (ch in('aeiouAEIOU')):
self.v += 1
if (ch == " "):
self.b += 1
self.c = self.u + self.l - self.v
def display(self):
print("The given String is : ",self.str)
print("Upper case Letters : ",self.u)
print("Lower Letters : ",self.l)
print("Vowels Letters : ",self.v)
print("Constant Letters : ",self.c)
print("Blank Space : ",self.b)
s = String()
s.getstr()
s.display()
OUTPUT:
Enter a String : Welcome to Computer Science
The given String is : Welcome to Computer Science
Upper case Letters : 3
Lower Letters : 21
..175.. A. PRABHAKAR-9442979144
– PRACTICAL EXERCISES
Vowels Letters : 10
Constant Letters : 14
Blank Space : 3
CONCLUSION:
The number of uppercase, lowercase, vowels, consonants and spaces are counted
successfully in the given string using class.
6. Create an Employee Table with the fields Empno, Empname, Desig, Dept, Age and Place. Enter
five records into the table
• Add two more records to the table.
• Modify the table structure by adding one more field namely date of joining.
• Check for Null value in doj of any record.
• List the employees who joined after 2018/01/01.
DB6 – MYSQL EMPLOYEE TABLE
AIM:
Create a database table named as “Employee” and insert the records into it, change the
structure of the table and select the required records from the table using SQL.
SQL QUERIES AND OUTPUT:
(i) Creating Table Employee:
mysql> Create table Employee
(Empno integer(4) primary key,
Empname varchar(20),
Desig varchar(10),
Dept varchar(10),
Age integer(2),
Place varchar(10));
(ii) View Table Structure:
mysql> Desc Employee;
..176.. A. PRABHAKAR-9442979144
– PRACTICAL EXERCISES
mysql> INSERT INTO ‘employee’ VALUES ('103', 'Ashok', 'Clerk', 'Accounts', '33', 'Tiruppur');
mysql> INSERT INTO ‘employee’ VALUES ('104', 'Vimal', 'Manager', 'Admin', '28', 'Udumalpet');
mysql> INSERT INTO ‘employee’ VALUES ('105', 'Yuvaraj', 'Officer', 'Accounts', '31', 'Tiruppur');
(iv) Select all the record:
mysql> select * from Employee;
..177.. A. PRABHAKAR-9442979144
– PRACTICAL EXERCISES
mysql> update employee set doj = '25-10-2017' where empno=1223;
mysql> update employee set doj = '17-06-2018' where empno=1224;
mysql> update employee set doj = '02-01-2018' where empno=1225;
mysql> update employee set doj = '31-12-2017' where empno=3226;
mysql> update employee set doj = '16-08-2015' where empno=3227;
mysql> select * from Employee;
Empty set
(ix) List the employees who joined after 01/01/2018:
mysql> Select * from emp where doj > '01-01-2018';
CONCLUSION:
An “Employee” database table was created and inserted the records into it, changed
the structure of the table and selected the required records from the table using SQL.
7. Create a table with following fields and enter data as given in the table below.
..178.. A. PRABHAKAR-9442979144
– PRACTICAL EXERCISES
Data to be entered:
..179.. A. PRABHAKAR-9442979144
– PRACTICAL EXERCISES
mysql> insert into student values('E1003','Rose',20,'ECE','EC2');
View all records:
mysql> select * from Student;
..180.. A. PRABHAKAR-9442979144
– PRACTICAL EXERCISES
mysql> select * from Student;
CONCLUSION:
The “Student” table was created and inserted the records into it and selected as well
as updated the records from the table using SQL.
8. Write a program using python to get 10 players name and their score. Write the input in a csv
file. Accept a player name using python. Read the csv file to display the name and the score. If the
player name is not found give an appropriate message.
..181.. A. PRABHAKAR-9442979144
– PRACTICAL EXERCISES
while(n <= 10): OUTPUT:
name = input("Player Name: ") Player Name: Dhoni
score = int(input("Score: ")) Score: 183
Player Name: Sachin
w.writerow([name,score])
Score: 200
n += 1 Player Name: Sehwag
print("Player File created") Score: 219
f.close() Player Name: Rohit
Score: 264
searchname = input("Enter the name to be searched: ")
Player Name: Virat
f = open('d:\Python313\player.csv','r') Score: 183
reader = csv.reader(f) Player Name: Ganguly
lst = [] Score: 183
for row in reader: Player Name: Dravid
lst.append(row) Score: 153
q = 0 Player Name: MS
Dhoni
for row in lst:
Score: 224
if searchname in row:
Player Name: Karthik
print(row)
Score: 79
q += 1
Player Name: Ashwin
if(q == 0): Score: 65
print("String not found")
Player File created
f.close()
Enter the name to be
CONCLUSION:
searched: Dhoni
A CSV file is created and performed read and write operations ['Dhoni', '183']
successfully.
9. Create a sql table using python and accept 10 names and age .sort in descending order of age
and display.
PY9 – PYTHON WITH SQL
AIM:
Program to create a SQL table that accepts the name and age of 10 students and then
shows the data in descending order based on the age of the students.
CODING:
import sqlite3
connection =sqlite3.connect("info.db")
cursor=connection.cursor()
cursor.execute("create table student(name,age)")
print("Enter 10 students name and their age respectively:")
for i in range(10):
who=[input("Enter Name: ")]
age=[int(input("Enter Age: "))]
n=len(who)
..182.. A. PRABHAKAR-9442979144
– PRACTICAL EXERCISES
for i in range(n):
cursor.execute("insert into student values(?,?)",(who[i], age[i]))
cursor.execute("select * from student order by age desc")
print("Displaying All the Records From student Table in Descending order of age:")
print(*cursor.fetchall(),sep='\n')
OUTPUT:
Enter 10 students name and their age respectively:
Enter Name: ALEX
Enter Age: 17
Enter Name: ASHOK
Enter Age: 19
Enter Name: BHARATHI
Enter Age: 17
Enter Name: RAMAKRISHNAN
Enter Age: 16
Enter Name: SARATHI
Enter Age: 19
Enter Name: NAVANEETHAN
Enter Age: 21
Enter Name: KISHORE
Enter Age: 14
Enter Name: VIMAL
Enter Age: 18
Enter Name: YUVARAJ
Enter Age: 13
Enter Name: PADMANATHAN
Enter Age: 20
Displaying All the Records From student Table in Descending order of age:
('NAVANEETHAN', 21)
('PADMANATHAN', 20)
('ASHOK', 19)
('SARATHI', 19)
('VIMAL', 18)
('ALEX', 17)
('BHARATHI', 17)
('RAMAKRISHNAN', 16)
('KISHORE', 14)
('YUVARAJ', 13)
CONCLUSION:
A SQL table created and stored the name and age of 10 students using Python and then
successfully displayed the data in descending order based on the age of the students.
..183.. A. PRABHAKAR-9442979144
– PRACTICAL EXERCISES
10. Write a program to get five marks using list and display the marks in pie chart.
PY10 – PYTHON GRAPHICS WITH PIP
AIM:
Program to get five marks using list and display the marks in pie chart.
CODING:
import matplotlib.pyplot as plt
marks=[]
i=0
subjects = ["Tamil", "English", "Maths", "Science", "Social"]
while i<5:
marks.append(int(input("Enter Mark = ")))
i+=1
for j in range(len(marks)):
print("{}.{} Mark = {}".format(j+1, subjects[j],marks[j]))
plt.pie (marks, labels = subjects, autopct = "%.2f ")
#plt.axes().set_aspect("equal")
plt.show()
OUTPUT:
Enter Mark = 99
Enter Mark = 78
Enter Mark = 100
Enter Mark = 89
Enter Mark = 88
1.Tamil Mark = 99
2.English Mark = 78
3.Maths Mark = 100
4.Science Mark = 89
5.Social Mark = 88
CONCLUSION:
The five subject marks are displayed in a pie chart successfully.
..184.. A. PRABHAKAR-9442979144
MARCH - 2024
Register Number
PART-II
COMPUTER SCIENCE
(English Version)
Time Allowed : 3.00 Hours ] [ Maximum Marks : 70
Instructions : (1) Check the question paper for fairness of printing. If there is any
lack of fairness, inform the Hall Supervisor immediately.
(2) Use Blue or Black ink to write and underline and pencil to draw
diagrams.
PART - I
Note : i) Answer all the questions. 15 x 1 = 15
ii) Choose the most appropriate answer from the given four alternatives and write
the option code and the corresponding answer.
1. Which of the following is used to describe the worst case of an algorithm?
a) Big W b) Big A c) Big O d) Big S
2. The datatype whose representation is unknown are called as:
a) Concrete datatype b) Built-in datatype c) Abstract datatype d) Derived datatype
3. Which key is pressed to execute Python Script?
a) F1 b) F5 c) F3 d) F2
4. Which of the following defines what an object can do?
a) Interface b) Operating System c) Interpreter d) Compiler
5. Which of the following security technique that regulates who can view or use resources in a computing
environment?
a) Access control b) Password c) Certification d) Authentication
6. Which of the following is the Slicing Operator?
a) <> b) {} c) () d) []
7. In Python the process of creating an object is called as
a) Initialize b) Constructor c) Instantiation d) Destructor
8. Pick the correct one to execute the given statement successfully.
if : print(x, "is a leap year")
a) x / 4 = 0 b) x% * 2 = 0 c) x% * 4 = 0 d) x% * 4 ==0
9. What symbol is used for SELECT statement?
a) X b) σ c) Ω d) Π
..185.. A. PRABHAKAR-9442979144
– MARCH 2024
10. If List [10, 20, 30, 40, 50] then List [2] = 35 will result:
a) [10, 20, 35, 40, 50] b) [35, 10, 20, 30, 40, 50]
c) [10, 35, 30, 40, 50] d) [10, 20, 30, 40, 50, 35]
11. A CSV file is also known as a
a) String File b) Flat File c) Random File d) 3D File
12. The most commonly used statement in SQL is:
a) execute b) cursor c) commit d) select
13. What is the output of the following snippet in Python?
for x in range (5):
if x==2:
continue
print(x, end =’ ‘)
a) 0 1 3 4 b) 0 1 2 c) 0 1 2 3 4 d) 0 1 2 3
14. is a collection of resources assembled to create a single unified visual display.
a) Objects b) Interface c) Graphics d) Dashboard
15. The clause used to sort data in a database:
a) GROUP BY b) SORT BY c) SELECT d) ORDER BY
PART II
Note : Answer any six questions. Question No. 24 is compulsory. 6 x 2 = 12
16. What is abstract data type?
17. What are the different operators that can be used in Python?
18. What is searching? Write its types.
19. Write the different types of function.
20. List the types of visualizations in Matplotlib.
21. What is the difference between Hierarchical and Network data model?
22. What is CSV file?
23. Which method is used to fetch all rows from the database table?
24. Write the use of pop() function in Python.
PART – III
Note : Answer any six questions. Question No. 33 is compulsory. 6 x 3 = 18
25. Differentiate pure and impure function.
26. What are the different ways to access the elements of a list? Give example.
27. Write a note on Asymptotic notation.
28. Using if..else..elif statement write a suitable program to display largest of 3 numbers.
29. Write a short note for the followings with suitable example.
a) capitalize() b) swapcase()
..186.. A. PRABHAKAR-9442979144
– MARCH 2024
30. How will you define Constructor and Destructor in Python?
31. What are the applications of scripting language?
32. What is the use of Where clause? Give a Python statement by using Where clause.
33. Write short notes on TCL Commands in SQL.
PART – IV
Note : Answer all the following questions. 5 x 5 = 25
34. a) How will you facilitate data abstraction? Explain it with suitable example.
-o0o-
..187.. A. PRABHAKAR-9442979144