0% found this document useful (0 votes)
33 views5 pages

New Created Sample Paper

The document contains a series of questions and exercises related to Python programming, SQL commands, and data handling. It includes topics such as data types, file operations, and database queries, along with assertions and reasoning questions. Additionally, it features practical coding tasks and theoretical questions aimed at assessing knowledge in computer science concepts.
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)
33 views5 pages

New Created Sample Paper

The document contains a series of questions and exercises related to Python programming, SQL commands, and data handling. It includes topics such as data types, file operations, and database queries, along with assertions and reasoning questions. Additionally, it features practical coding tasks and theoretical questions aimed at assessing knowledge in computer science concepts.
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/ 5

Section – A (a) 25*50!100!25 (b) 50* 100!100!

100
(c) 25*50!100!100 (d) Error
1. State True or False:

Digits are one of the parts of the Python character set. 8. Which of the following is a category of SQL commands?
(a) DDL (b) TCL (c) DML (d) All of these
2. Which of the following are the most obvious kind of constants?
(a) Keywords (b) Literals (c) Variables
(d) Identifiers 9. In the following code, which lines will give error? (Assume the lines are
numbered starting from 1.)
mul=3
value=10
3. Which of the following operator cannot be used with string data type?
for i in range (1, 6, 1):
(a) + (b) in (c) * (d) /

if (value % mul = 0):


4. What is the output of the following code? [1]
num = 4 + float (7)/int (2.0) print (value * multiply)
print (“num =”, num)
(a) num 7.5 (b) 7.5 (c) num : 7.5 (d) Error else

5. Given : s=”ComputerExam”. What will be the output of print (value + multiply)


print(s[2]+s[8]+s[1:5])? (a) 4, 5
(a) mEOMUU (b) mEompu (c) mEomPU (d) MEompu (b) 4,5,6
(c) 4,5,6,7
(d) No errors
6. Which of the following types of files will need the pickle module for
working on it?
(a) Binary’ files (b) Text files (c) CSV files (d) All of these 10.Fill in the blank : There can be ……….. foreign keys in a relation.

7. What will be the output of the following Python code? 11. Which of the following functions will read lines of a text file as list elements?
V = 25 (a) read()
(b) get()
def Fun (Ch) : (c) readline()
(d) readlines()
V=50
12. Fill in the blank :
The ………. clause with the COUNT0 function counts only the unique values in an
print (V, end=Ch)
attribute.
V *= 2
(a) UNIQUE (b) HAVING (c) DISTINCT (d) LIKE
print (V, end=Ch)

print (V, end="*") 13. State whether the following statement is True or False.
Telnet is a protocol used for remote login.
Fun ("!")

print (V)
14. Which of the following will be the output of the statement given below? Or
print([12,34,56,78,90] . pop( ))
(a) 78 (b) 90 (c) 12 (d) 12,34,56,78,90 (i) Name the protocol defines how messages are formatted and transmitted.
(ii) Give one major disadvantage of bluetooth.

15. GSM is a standard set developed by the


(a) European Telecommunications Standards Institute 20.Find the error(s). [2]
(b) Telecommunication Institute
(c) Quality of Service
(d) None of the above
Answer:
(a) European Telecommunications Standards Institute [1]

16. Identify the first network which was based on TCP/IP protocol.
(a) Arpanet (b) Hub (c) Ethernet Card (d) Router 21. Observe the code and write the output:
(a) arpanet t = ‘HELLO’
t1 = tuple(t)
print(t1)
Directions In the question numbers 17 and 18, a statement of Assertion (A) is
print(t1[1:3])
followed by a statement of Reason (R). Choose the correct option.

17. Assertion (A) To use the randint() function, the random module needs to be
Or
included in the program.
Reason (R) Some functions are present in modules and to use them the
respective module needs to be imported. Predict the output of the following code:
(a) Both A and R are true and R is the correct explanation of A. x = (1, 2, 3)
(b) Both A and R are true but R is not the correct explanation of A. y = (3, 4)
(c) A is true but R is false. t=x+y
(d) A is false but R is true. print(t)
t[2] = 4
print(t)
18. Assertion (A) The contents of a Binary file are not directly interpretable.
Reason (R) Modes in which binary files can be opened are suffixed with ‘b’ like :
rb/wb etc. 22. Differentiate between an attribute and a tuple with an example.
(a) Both A and R are true and R is the correct explanation of A.
(b) Both A and R are true but R is not the correct explanation of A. Or
(c) A is true but R is false.
(d) A is false but R is true. Consider the following table with their fields
EMPLOYEE (E_CODE, E_NAME, DESIG, SALARY, DOJ)
List the names, salary, PF, HRA, DA of all the employees in the EMPLOYEE
Section – B table. HRA is 25% of salary and DA is 10% of salary. PF is 5% of salary. The
result should be in descending order of salary.
Question 19.
(i) Expand the following : PAN, SMTP
(ii) Name the term defined by given below statement. 23: Differentiate between identifier and keyword.
“ A group of computers connected to each other by a link”.
24.Identify the output of the following Python code.
My first book was Me and My Family.
D={1 : “One", 2 : “Two”, 3 : "Three”} It gave me chance to be known to the world.
L=[]
for K, V in D.items( ):
if V[0] = = “T”: The output of the function should be
L.append (K) No. of times “my” occur : 2
print(L)
Or
28. Write the output of the queries (i) to (iii) based on the table FURNITURE
Identify the output of the following Python statement. [2] given below.

lst1 = [10, 15, 20, 25, 30] Table : FURNITURE


lst1.insert(3, 4)
lst1.insert(2, 3)
print (lst1[-5])

25. Write the short note on (i) isupper() (ii) join()


Section – C

26. Write the output for SQL queries (i) to (iii), which are based on the table (i) SELECT SUM(DISCOUNT) FROM FURNITURE WHERE COST > 15000 ;
CARDEN. (ii) SELECT MAX( DATEOFPURCHASE) FROM FURNITURE ;
(iii) SELECT * FROM FURNITURE WHERE DISCOUNT>5 AND FID LIKE ”T%”;

29. Write a user-defined function findname (name), where name is an


argument in Python to delete phone number from a dictionary phonebook on
the basis of the name, where name is the key.

30. Write Push (contents) and Pop (contents) methods in Python to add
numbers and remove numbers considering that to act as Push and Pop
(i) SELECT COUNT(DISTINCT Make) FROM CARDEN; operations of stack.
(ii) SELECT COUNT(*) Make FROM CARDEN; Answer:
(iii) SELECT CarName FROM CARDEN WHERE Capacity = 4;
Section – D

27. Write a function Del() to delete the 4th word from a text file school.txt. Question 31.
Consider the table APPLICANTS. [1 × 4 = 4]
Or

Write a function county() in Python to read the text file “Data.txt” and count the
number of times “my” occurs in the file.
For example If the file contents are:
TABLE: APPLICANTS

Write statements to
(a) Increase FEE of “M” (Male) applicants by 2000.
(b) Display details of “F” (Female) applicants in descending order of FEE.
(c) Change width of column FEE to 20.
(d) Remove the column C_ID.
(i) Suggest a suitable cable layout of connectivity of the offices.
(ii) Suggest placement of server in the network with suitable reason.
32. (iii) Suggest placement of following devices in the network:
Riya is a student of class 12. Her teacher assigned a work to Riya to create a (a) Switch/Hub
CSV file named Record.csv, to store the details of books available in (b) Repeater
department. The structure of Record.csv is: (iv) Suggest a suitable topology for connecting the computers in each building.
[‘BookID’, ‘AuthorName’, Price] (v) Write any one advantage of the topology suggested.
For maintaining all records of books, Riya wants to write the following user
defined functions:
Insert() Enter the detail of books as book id, author name and price and add
34.
this details to CSV file Record.csv
(a) Describe the following terms
Total () Display the total number of books present in record of CSV file
(i) Domain
As a Python expert, help her to achieve this task.
(ii) DB2
(b) Write the code to create a table Product in database Inventory with
following fields
33. Sony corporation has set up its 4 offices in the city of Srinagar, with its
offices X, Z, Y, U:
Fields Datatype

PID varchar(5)

PName char(30)

Price float
Rank varchar(2)

Note the following to establish the connection between Python and MySQL:

Host: localhost Username : system Password : hello


Database : Inventory

Or

(a) Identify commands/functions for the following action.


To add a new column to a table.
(b) Which data will get added in table Company by following code?

35.
(i) Does Python create a file itself if the file doesn’t exist in the memory?
Illustrate your answer with an example.
(ii) Write a program using following functions:
inputStud() To input details of as many students and add them to a csv file
“college.csv” ‘
without removing the previous records.
SrNo Studname City Percentage
readCollege() To open the file “college.csv” and display records whose city is
“Kolkata”

Or

(i) Write a statement to create a data.txt file with the following text.
” Python file handling is very interesting”
(ii) Write a Python code using two functions as follows :
removeRow() To remove a record from the college file “College.csv” having
following structure.
SrNo Studname City Percentage
getCollege() To read the records of the college file “College.csv” and display
names of students whose names start with a lowercase vowel. [5]
Answer:
(i) Python will create a file automatically when the open function is used with
write mode.

You might also like