12 TH Answer Key
12 TH Answer Key
SCHOOL E – VELANUR
CLASS: XII-A,E1,E2,E3 SUBJECT:COMPUTER SCIENCE KEY ANSWER DATE:11-01-2021
1.B) Recursion 2.D) Def 3.C) Def 4.D)udaNlimaT 5.A)+ 6.A) {}
7.C) [10,20,30,40,50] 8.D) {1,3,6,9} 9.B) 8 10. B) . 11. B) Tamil
12. C) Edgar Frank Codd 13.B) Row 14. D) Alter 15.A) Select
16. What is function?
Functions are named blocks of code that are designed to do one specific job.
Function blocks begin with the keyword “def ” followed by function name and parenthesis ().
17. Main advantages of functions are ,
o It avoids repetition and makes high degree of code reusing.
o It provides better modularity for your application.
18. What is String?
String is a data type in python, used to handle array of characters.
String is a sequence of characters that may be a combination of letters, numbers, or special
symbols enclosed within single, double or even triple quotes.
19. HALF YEARLY EXAM HALF YEARLY EXAM HALF YEARLY EXAM HALF YEARLY
EXAM HALF YEARLY EXAM.
20. How will you access the list elements in reverse order?
Python enables reverse or negative indexing for the list elements.
A negative index can be used to access an element in reverse order.
Thus, python lists index in opposite order.
The python sets -1 as the index value for the last element in list and -2 for the preceding
element and so on.
This is called as Reverse Indexing.
21. What is set in Python?
In python, a set is another type of collection data type.
A Set is a mutable and an unordered collection of elements without duplicates or repeated
element.
This feature used to include membership testing and eliminating duplicate elements.
22. How will you create constructor in Python?
“init” is a special function begin and end with double underscore in Python act as a
Constructor.
Constructor function will automatically executed when an object of a class is created.
General format:
def init (self, [args .......... ]):
<statements>
23. List some examples of RDBMS.
SQL Server
Oracle
MySQL
MariaDB
SQLite
25.
26.
OUTPUT:
Number 1: 34
Number 2: 54
The sum of 34 and 54 is 88
29. Output:
>>>
Good Morning Bindu Madhavan
30. Variables defined inside a class are called as “Class Variable” and functions are called as
“Methods”.
Class variable and methods are together known as members of the class.
statement_n
31. Database Administrator or DBA is the one who manages the complete database management
system.
DBA takes care of the security of the DBMS, managing the license keys, managing user
accounts and access etc.
STRING OPERATORS
Python provides the following string operators to manipulate string.
i)Concatenation (+)
(ii) Append (+ =)
(iii) Repeating (*)
(iv) String slicing
(v) Stride when slicing string Explains
35. range():
The range( ) is a function used to generate a series of values in Python.
Using range( ) function, you can create list with series of values.
The range( ) function has three arguments.
Syntax of range ( ) function:
range (start value, end value, step value)
where,
start value – beginning value of series. Zero is the default beginning value.
end value – upper limit of series. Python takes the ending value as upper limit – 1.
step value – It is an optional argument, which is used to generate different interval of values.
CODE:
x=int(input("Enter first number:")) y=int(input("Enter second number:")) if x>y:
min=x
else:
min=y
while(1):
if((min%x == 0) and (min % y == 0)): print("LCM is:",min)
break min=min+1
OUTPUT:
Enter first number:2 Enter second number:3 LCM is: 6
38. (i) To display the details of all employees in descending order of pay.
SELECT * FROM employee ORDER BY DESC;
(ii) To display all employees whose allowance is between 5000 and 7000.
SELECT * FROM employee WHERE allowance BETWEEN 5000 AND 7000;
(iii) To remove the employees who are mechanic.
DELETE FROM employee WHERE desig=‟Mechanic‟;
(iv) To add a new row.
INSERT INTO employee
(empcode,name,desig,pay,allowance)VALUES(S1002,Baskaran,Supervisor,29000,12000);
(v) To display the details of all employees who are operators.
SELECT * FROM employee WHERE design=‟Operator‟; OR