
PRACTICE QUESTION PAPER
COMPUTER SCIENCE (083)
SECTION A
-
State whether the following statement is True or False:
print() method without any argument shall display a blank line. -
Identify the output of the following code snippet:
string=”LearnPythonProgramming”
result=string.strip().upper().replace(“”,”_”)
print(result)
(a) LEARNPYTHONPROGRAMMING
(b) Learn_Python_Programming
(c) Learn_python_programming
(d) LEARN_PYTHON_PROGRAMMING
-
Which of the following expressions evaluates to True?
(a) 5 * 2 == 10 and not (7 <= 5 or 3 == 4)
(b) 8 > 10 or (4 == 4 and 6 > 8)
(c) 12 != 12 or (3 * 2 < 5 and 4 == 4)
(d) 15 < 10 and (2 < 3 or 8 == 8) -
What will be the output of the following code?
text=”HelloWorld”
print(text.lower().replace(“o”,”0″))
(a) hello w0rld
(b) Hello W0rld
(c) hell0 w0rld
(d) Hello World
-
What will be the output of the following code snippet?
text=”AdvancedProgramming”
result=text[-12:-5][::-1]
print(result) -
What will be the output of the following code?
data={‘A’:(5,8),’B’:(3,6),’C’:(7,2)}
result=data[‘A’][1]+data[‘B’][0]-data[‘C’][1]
print(result) -
If student_info is a dictionary as given below, which statement will raise an error?
student_info={‘id’:101,’name’:’John’,’grade’:’A’} -
What does list.sort() method do in Python?
-
EMPLOYEES table has 4 rows and 3 columns and PROJECTS table has 3 rows and 2 columns.
Find the degree and cardinality after Cartesian Product. -
Write the missing statement:
file=open(“data.txt”,”r”)
data=file.read(200)
new_data=file.read(100)
file.close()
-
State whether the following statement is True or False:
The process of fixing errors in a program is called debugging. -
What will be the output of the following code?
x=15
def modify():
global x
x=x+5
print(“Inside function:”,x)
modify()
print(“Outside function:”,x) -
Which SQL command is used to delete the entire table?
-
What will be the output of the following query?
SELECT COUNT(DISTINCT album_no)
FROM Music
WHERE artist_name IS NOT NULL; -
Which of the following is NOT a valid SQL data type?
(a) VARCHAR
(b) TEXT
(c) BOOLEAN
(d) STRING -
To find average salary of employees, which SQL function is used?
-
Which protocol is used to send e-mails?
-
Which device connects multiple networks and translates protocols?
-
Explain bandwidth in computer networks.
-
Assertion (A): Default arguments must be placed after non-default arguments.
Reason (R): This ensures correct parameter order. -
Assertion (A): GROUP BY is used to aggregate data.
Reason (R): HAVING filters records after aggregation.
SECTION B
-
Differentiate between List and Tuple with examples.
-
Explain any two dictionary methods with syntax.
-
Write Python statements:
(i) Insert ‘orange’ at second position in list fruits
OR
Extend numbers list by [4,5]
(ii) Remove ‘banana’
OR
Find sum of numbers list
-
Identify output and find minimum and maximum possible values of variable start.
-
Correct the errors in the following code:
def calculate_average(nums):
total=0
for i in nums
total+=i
average=total/len(nums)
return “average”
(i) Name the constraint that allows NULL but no duplicate values
OR
Name the constraint used to relate two tables
(ii) Write SQL command to add NOT NULL constraint
OR
Write SQL command to add DEFAULT value
-
Write any two advantages of optical fibre cable
OR
What is VoIP?
SECTION C
-
Write a Python function to find the longest word in a file
OR
Write a function to reverse lines of a file -
Write stack operations for customer records
OR
Write stack operations for numbers divisible by 5 -
Predict the output of the given Python code
OR
Predict the output of list operations
SECTION D
-
Consider the table GIFTS and write SQL queries
OR
Write output of the given SQL queries -
A CSV file “Success.csv” contains survey data.
Write functions to:
(i) Display records with population > 30000000
(ii) Count number of records -
Using EMPLOYEES and PROJECTS tables, write required SQL queries.
-
Write Python functions to insert and retrieve records from FLORIST table using database connectivity.
SECTION E
-
Write Python functions to manage book records in a binary file.
-
A company plans a campus network.
Answer questions related to server location, cabling, repeater, hardware and network type.
If you want the solutions for this question paper, please fill the form.
We will share the answers with you.
