0% found this document useful (0 votes)
43 views6 pages

Set 1

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

Set 1

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

r -

Time Allowed: 3 hours Maximum Marks: 70


General Instructions:
Please check this question paper contains 35 questions.
The paper is divided into 4 Sections- A, B, C, D and E.
Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
All programming questions are to be answered using Python Language only.
Section A
1.State true or false: [1]
Do both the following represent the same list.
['a', 'b', 'c']
['c', 'a', 'b']

2.Which operator performs pattern matching? [1]

a) LIKE operator b) BETWEEN operator

c) None of these d) EXISTS operator

3.Which of the following is correct to retrieve any character at index 'i' in string 's'? [1]

a) s. getitem (i) b) s.getitem(i-1)

c) s. getitem (i-1) d) s.getitem(i)

4.What will be the output of the following code? [1]

value = 50
def display(N):
global value
value = 25
if N%7==0:
value = value +
N else:
value = value - N

Page 1
------- _i
r -I

print(value, end="#")
display(20)
print(value)

a) 5#50# b) 50#50

c) 50#5 d) 50#30

5. Signals generated by an operating system to send it over phone line must be further
[1] converted into a/an

a) analog signal b) microwave

c) AC signal d) digital signal

6. To read the next line of the file from a file object infi, we use
[1]

a) infi.read() b) infi.readlines() d)

c) infi.readline() infi.read(all)

7. What is default value of host? a) localhost

c) Host b) global host

d) None of these

8. Which of the following sublanguages of SQL is used to define the structure of the
[1]
relation, deleting relations and relating schemas?

a) Relational Schema b) DDL (Data Definition Language)

c) DML (Data Manipulation d) Query


Language)

9. Which function is used to read all the characters?


[1]

a) readcharacters( ) b) read( )

c) readchar( ) d) readall( )

10. What will be the output of the following Python code?


[1]

Page 2
def add (num1,
num2): sum =
num1 + num2
r -

sum = add(20,
30) print(sum)

a) None b) Null

c) 50 d) 0

11. Consider the following operation performed on a stack of size 5.


[1]
Push(1); Pope; Push(2); Push(3); Pop(); Push(4); Pop(); Pop(); Push(5);
After the completion of all operation, the number of elements present in stack
are:

a) 4 b) 3

c) 1 d) 2

12. Which of the following is the use of function in python?


[1]

a) Functions don't provide betterb) Functions are reusable pieces of


modularity for your application programs

c) you can't also create your own d) All of these


functions

13. State true or false:


[1]
PING checks if a computer is connected to a network or not.

14._The process of converting a data type into another data type is known
as_____________________________________________________________________________. [1]
a) expression b) type conversion
c) operator d) comparison

15. Fill in the blanks:


[1]
_operator is used to match a value similar to specific pattern in a column
using % and _.

16. CDMA stands for?


[1]

a) Call Division Multiple Access b) Channel Division Multiple Access

c) Cell Division Multiple Access d) Code Division Multiple Access

Page
3
--
r 1
1

17. Assertion (A): The intersection_update() method is different from the


intersection() [1] method.
Reason (R): intersection_update() method modifies the original set by
removing the unwanted items.

a) Both A and R are true and R is b) Both A and R are true but R is
the correct explanation of A. not the correct explanation of A.

c) A is true but R is false. d) A is false but R is true.

18. Assertion (A): CSV stands for comma-separated values, which is defined
as a simple [1] file format that uses specific structuring to arrange tabular data.
Reason (R): The csv module is used to handle the CSV files to read/write
and get data from specified columns.

a) Both A and R are true and R is b) Both A and R are true but R is
the correct explanation of A. not the correct explanation of A.

c) A is true but R is false. d) A is false but R is true.

Section B
19. Answer:

(i) i. What is modulation?

ii. Write one characteristic each for 2G and 3G mobile technologies.

OR
i. What are the basic methods of checking errors in the data being [2]
transmitted over networks?

20. Write Python code to create a table location with the following fields
[2]
id d of the location
bidycode code of the building
room type of rooms
capacity capacity of the room

21.Rewrite the following code in python after removing all syntax error(s).
[2]
Underline each correction done in the code.
30 = To
for K in range(0,To)
IF k%4== 0:
print (K * 4)
Page 4
Else:
print (K + 3)
OR
What is the output of the following?
True = False
while True:
print(True)
break

22. Answer: [2]


(i)Which command is used to import mysql.connector package with an identifier? [1]

(ii)What will the following query do? [1]


import mysql.connector
db = mysql.connector.connect(..)
cursor = db.cursor()
person_id = input ("Enter required person id")
lastname = input ("Enter required lastname")
db.execute("INSERT INTO staff (person_id, lastname) VALUES ({}, 'if) ".
format(person id, lastname))
db.commit( )
b.close( )

23. Differentiate between a logical error and syntax error. Also, give suitable examples of [2]
each in Python.

OR
As immutable types cannot be changed in place then the following code should raise an
error which modifies an int (an immutable type) variable. But it produces no error. Why?
A = 22
A += 2

24. Consider a binary file Employee.dat containing details such as empno:ename:salary [2]
(separator ':'). Write a Python function to display details of those employees who
are earning between 20000 and 40000. (Both values inclusive)

OR
A text file(say an.txt) contains alphanumeric text. Write a program that reads this text
file and prints only the numbers or digits from the file.

25. Write a function that takes a positive integer and returns the one's position digit of [2]
the integer.

Page 5

You might also like