Self-Evaluation Gradecard
0 / 70 Marks (0%)
Tick off each step-marking rubric box below that you accurately derived on your answer sheet. Full CBSE model answers and marking breakdown are unlocked as you self-grade.
1
Section A(1-Mark Questions)
1 Mark
State True or False:
The Python interpreter handles logical errors during code execution.
The Python interpreter handles logical errors during code execution.
2
Section A(1-Mark Questions)
1 Mark
Identify the output of the following code snippet:
``
``
python
text = "PYTHONPROGRAM"
text = text.replace('PY', '#')
print(text)
`
(A) #THONPROGRAM
(B) ##THON#ROGRAM
(C) #THON#ROGRAM
(D) #YTHON#ROGRAM`3
Section A(1-Mark Questions)
1 Mark
Which of the following expressions evaluates to False?
(A)
(B)
(C)
(D)
(A)
not(True) and False(B)
True or False(C)
not(False and True)(D)
True and not(False)4
Section A(1-Mark Questions)
1 Mark
What is the output of the expression?
``
(D) Error
``
python
country = 'International'
print(country.split("n"))
`
(A) ('I', 'ter', 'atio', 'al')
(B) ['I', 'ter', 'atio', 'al']
(C) ['I', 'n', 'ter', 'n', 'atio', 'n', 'al']`(D) Error
5
Section A(1-Mark Questions)
1 Mark
What will be the output of the following code snippet?
``
``
python
message = "World Peace"
print(message[-2::-2])
``6
Section A(1-Mark Questions)
1 Mark
What will be the output of the following code?
``
(A) True
(B) False
(C) tuple1
(D) Error
``
python
tuple1 = (1, 2, 3)
tuple2 = tuple1
tuple1 += (4,)
print(tuple1 == tuple2)
``(A) True
(B) False
(C) tuple1
(D) Error
7
Section A(1-Mark Questions)
1 Mark
If
``
my_dict is a dictionary as defined below, then which of the following statements will raise an exception?``
python
my_dict = {'apple': 10, 'banana': 20, 'orange': 30}
`
(A) my_dict.get('orange')
(B) print(my_dict['apple', 'banana'])
(C) my_dict['apple'] = 20
(D) print(str(my_dict))`8
Section A(1-Mark Questions)
1 Mark
What does the
(A) Removes the element at index x from the list
(B) Removes the first occurrence of value x from the list
(C) Removes all occurrences of value x from the list
(D) Removes the last occurrence of value x from the list
list.remove(x) method do in Python?(A) Removes the element at index x from the list
(B) Removes the first occurrence of value x from the list
(C) Removes all occurrences of value x from the list
(D) Removes the last occurrence of value x from the list
9
Section A(1-Mark Questions)
1 Mark
If a table has one Primary key and two alternate keys, how many Candidate keys will this table have?
(A) 1
(B) 2
(C) 3
(D) 4
(A) 1
(B) 2
(C) 3
(D) 4
10
Section A(1-Mark Questions)
1 Mark
Write the missing statement to complete the following code:
``
``
python
file = open("example.txt", "r")
data = file.read(100)
____________________ # Move the file pointer to the beginning of the file
next_data = file.read(50)
file.close()
``11
Section A(1-Mark Questions)
1 Mark
State whether the following statement is True or False:
The
The
finally block in Python is executed only if no exception occurs in the try block.12
Section A(1-Mark Questions)
1 Mark
What will be the output of the following code?
``
``
python
c = 10
def add():
global c
c = c + 2
print(c, end='#')
add()
c = 15
print(c, end='%')
`
(A) 12%15#
(B) 15#12%
(C) 12#15%
(D) 10#15%`13
Section A(1-Mark Questions)
1 Mark
Which SQL command can change the degree of an existing relation?
14
Section A(1-Mark Questions)
1 Mark
What will be the output of the query?
(A) Details of all products whose names start with 'App'
(B) Details of all products whose names end with 'App'
(C) Names of all products whose names start with 'App'
(D) Names of all products whose names end with 'App'
SELECT * FROM products WHERE product_name LIKE 'App%';(A) Details of all products whose names start with 'App'
(B) Details of all products whose names end with 'App'
(C) Names of all products whose names start with 'App'
(D) Names of all products whose names end with 'App'
15
Section A(1-Mark Questions)
1 Mark
In which datatype is the stored value padded with spaces to fit the specified length?
(A) DATE
(B) VARCHAR
(C) FLOAT
(D) CHAR
(A) DATE
(B) VARCHAR
(C) FLOAT
(D) CHAR
16
Section A(1-Mark Questions)
1 Mark
Which aggregate function can be used to find the cardinality of a table?
(A)
(B)
(C)
(D)
(A)
sum()(B)
count()(C)
avg()(D)
max()17
Section A(1-Mark Questions)
1 Mark
Which protocol is used to transfer files over the Internet?
(A) HTTP
(B) FTP
(C) PPP
(D) HTTPS
(A) HTTP
(B) FTP
(C) PPP
(D) HTTPS
18
Section A(1-Mark Questions)
1 Mark
Which network device is used to connect two networks that use different protocols?
(A) Modem
(B) Gateway
(C) Switch
(D) Repeater
(A) Modem
(B) Gateway
(C) Switch
(D) Repeater
19
Section A(1-Mark Questions)
1 Mark
Which switching technique breaks data into smaller packets for transmission, allowing multiple packets to share the same network resources?
20
Section A(1-Mark Assertion-Reason Questions)
1 Mark
Two statements are given, one labelled Assertion (A) and the other labelled Reason (R):
Assertion (A): Positional arguments in Python functions must be passed in the exact order in which they are defined in the function signature.
Reasoning (R): This is because Python functions automatically assign default values to positional arguments.
Select the correct answer:
(A) Both A and R are true and R is the correct explanation for A
(B) Both A and R are true and R is not the correct explanation for A
(C) A is True but R is False
(D) A is False but R is True
Assertion (A): Positional arguments in Python functions must be passed in the exact order in which they are defined in the function signature.
Reasoning (R): This is because Python functions automatically assign default values to positional arguments.
Select the correct answer:
(A) Both A and R are true and R is the correct explanation for A
(B) Both A and R are true and R is not the correct explanation for A
(C) A is True but R is False
(D) A is False but R is True
21
Section A(1-Mark Assertion-Reason Questions)
1 Mark
Two statements are given, one labelled Assertion (A) and the other labelled Reason (R):
Assertion (A): In SQL, a foreign key can accept duplicate values.
Reasoning (R): A foreign key must uniquely identify each record in the child table.
Select the correct answer:
(A) Both A and R are true and R is the correct explanation for A
(B) Both A and R are true and R is not the correct explanation for A
(C) A is True but R is False
(D) A is False but R is True
Assertion (A): In SQL, a foreign key can accept duplicate values.
Reasoning (R): A foreign key must uniquely identify each record in the child table.
Select the correct answer:
(A) Both A and R are true and R is the correct explanation for A
(B) Both A and R are true and R is not the correct explanation for A
(C) A is True but R is False
(D) A is False but R is True
22
Section B(2-Mark Questions)
2 Marks
How is a mutable object different from an immutable object in Python? Identify one mutable object and one immutable object from the following:
(1, 2), [1, 2], {1: 1, 2: 2}, '123'23
Section B(2-Mark Questions)
2 Marks
Give two examples of each of the following:
(I) Arithmetic operators
(II) Relational operators
(I) Arithmetic operators
(II) Relational operators
24
Section B(2-Mark Questions)
Internal Choice (OR)2 Marks
If
(I)
A) Write a statement to count the occurrences of
OR
B) Write a statement to sort
A) Write a statement to append all elements of
OR
B) Write a statement to reverse the elements of
L1 = [1, 2, 3, 2, 1, 2, 4, 2, ...] and L2 = [10, 20, 30, ...], then (answer using built-in functions/methods only):(I)
A) Write a statement to count the occurrences of
4 in L1.OR
B) Write a statement to sort
L1 in ascending order in-place.(II)A) Write a statement to append all elements of
L2 at the end of L1.OR
B) Write a statement to reverse the elements of
L2 in-place.25
Section B(2-Mark Questions)
2 Marks
Identify the correct output(s) of the following code. Also write the minimum and maximum possible values of the variable
``
b:``
python
import random
a = "Wisdom"
b = random.randint(1, 6)
for i in range(b):
print(a[i], end="*")
print()
`
Possible Outputs:
(A) Wis*
(B) Wisdom
(C) W*
(D) isd*`26
Section B(2-Mark Questions)
2 Marks
The code provided below is intended to swap the first and last elements of a given tuple. However, there are syntax and logical errors in the code. Rewrite it after removing all errors. Underline all corrections made:
``
``
python
def swap_first_last(tup):
if len(tup) < 2:
return tup
new_tup = tup[-1] + tup[1:-1] + tup[0] # Errors here
return new_tup
result = swap_first_last((1, 2, 3, 4))
print("Swapped tuple:", result)
``27
Section B(2-Mark Questions)
Internal Choice (OR)2 Marks
(I)
A) What constraint should be applied on a table column so that duplicate values are not allowed in that column, but NULL is allowed?
OR
B) What constraint should be applied on a table column so that NULL values are not allowed?(II)
A) Write the SQL command to drop the Primary Key constraint from table
OR
B) Write the SQL command to add a Primary Key on column
A) What constraint should be applied on a table column so that duplicate values are not allowed in that column, but NULL is allowed?
OR
B) What constraint should be applied on a table column so that NULL values are not allowed?(II)
A) Write the SQL command to drop the Primary Key constraint from table
MOBILE.OR
B) Write the SQL command to add a Primary Key on column
M_ID in existing table MOBILE.28
Section B(2-Mark Questions)
Internal Choice (OR)2 Marks
A) List one advantage and one disadvantage of Star Topology.ORB) Expand the term SMTP. What is the use of SMTP?
29
Section C(3-Mark Questions)
Internal Choice (OR)3 Marks
A) Write a Python function
show() that reads a text file "Emails.txt" and displays all words containing '@cmail'.ORB) Write a Python function long_words() that reads a text file "Story.txt" and finds and displays all words longer than 5 characters along with the total count of such words.30
Section C(3-Mark Questions)
3 Marks
You have a stack named
Write Python functions to perform the following operations on
(I)
(II)
(III)
BooksStack that contains records of books. Each book record is represented as a list: [book_title, author_name, publication_year].Write Python functions to perform the following operations on
BooksStack:(I)
push_book(BooksStack, new_book) to push a book onto the stack.(II)
pop_book(BooksStack) to pop and return a book from the stack. Display 'Underflow' if the stack is empty.(III)
peep(BooksStack) to display the topmost book without removing it. Display 'None' if the stack is empty.31
Section C(3-Mark Questions)
Internal Choice (OR)3 Marks
A) Predict the output of the following code:
``
``
python
d = {"apple": 15, "banana": 7, "cherry": 9}
str1 = ""
for key in d:
str1 = str1 + str(d[key]) + "@" + "\n"
str2 = str1[:-1]
print(str2)
`ORB) Predict the output of the following code:
`python
for i in range(1, 4):
for j in range(1, i + 1):
print(j, end=" #")
print()
``32
Section D(4-Mark Questions)
4 Marks
Consider the table
Write SQL queries for the following:
(I) Display product names and total quantity ordered for products where total quantity is at least 5.
(II) Display all details of orders in descending order of Price.
(III) Display all unique customer names from the orders table.
(IV) Calculate the total price of all orders where Quantity is NULL.
ORDERS with schema (O_Id, C_Name, Product, Quantity, Price).Write SQL queries for the following:
(I) Display product names and total quantity ordered for products where total quantity is at least 5.
(II) Display all details of orders in descending order of Price.
(III) Display all unique customer names from the orders table.
(IV) Calculate the total price of all orders where Quantity is NULL.
33
Section D(4-Mark Questions)
4 Marks
A CSV file
Write Python functions to:
(I) Read and display all records where Population is greater than 5,000,000 (skip header row).
(II) Accept country name, population, sample size, and happiness score from user and write as a new row to
"Happiness.csv" contains records with: [Country, Population, Sample_Size, Happiness_Score].Write Python functions to:
(I) Read and display all records where Population is greater than 5,000,000 (skip header row).
(II) Accept country name, population, sample size, and happiness score from user and write as a new row to
"Happiness.csv".34
Section D(4-Mark Questions)
4 Marks
Consider tables
Write SQL queries for:
(I) Display all details of faculty members along with courses taught by them for faculty members earning less than 12000.
(II) Display all courses whose fees are between 20000 and 50000.
(III) Increase the fees by 500 for all courses having 'Computer' anywhere in their name.
(IV) Display course name and faculty first name for all courses.
FACULTY (F_ID, FName, LName, Salary) and COURSES (C_ID, CName, Fees, F_ID).Write SQL queries for:
(I) Display all details of faculty members along with courses taught by them for faculty members earning less than 12000.
(II) Display all courses whose fees are between 20000 and 50000.
(III) Increase the fees by 500 for all courses having 'Computer' anywhere in their name.
(IV) Display course name and faculty first name for all courses.
35
Section D(4-Mark Questions)
4 Marks
A table
Write a Python program using
- Accept item details from user and insert into
- Fetch and display all records where
STATIONERY in MySQL database ITEMDB has fields: itemNo (int), itemName (varchar), price (float), qty (int).Write a Python program using
mysql.connector to connect to ITEMDB (user: 'root', password: 'Pencil') and perform the following:- Accept item details from user and insert into
STATIONERY.- Fetch and display all records where
price > 100.36
Section E(5-Mark Questions)
5 Marks
A recruitment agency needs to manage candidate records in a binary file
Write Python functions to:
(I)
(II)
"candidates.dat". Each record is a list: [candidate_id, candidate_name, designation, salary].Write Python functions to:
(I)
input_candidates(): Accept candidate records from the user and write them into "candidates.dat" using the pickle module. [2.5 Marks](II)
search_candidate(cand_id): Read "candidates.dat" and display the details of the candidate with the given cand_id. If not found, display 'Candidate not found'. [2.5 Marks]37
Section E(5-Mark Case Study (Computer Networks))
5 Marks
Event Horizon Enterprises is planning to set up its India campus in Mumbai with its head office in Delhi. The Mumbai campus has four blocks/buildings:
- Admin Block: 110 Computers
- Finance Block: 35 Computers
- Design Block: 25 Computers
- HR Block: 15 Computers
Distances between blocks:
- Admin to Finance: 40 m
- Admin to Design: 120 m
- Admin to HR: 90 m
- Finance to Design: 80 m
- Finance to HR: 150 m
- Design to HR: 70 m
- Mumbai Campus to Delhi Head Office: 1400 kmAnswer the following questions:
(I) Suggest the most suitable block to install the server in the Mumbai campus with suitable justification. [1 Mark]
(II) Suggest the best network device to connect all computers within each block. [1 Mark]
(III) Draw the most economical cable layout to connect all four blocks in Mumbai campus. [1 Mark]
(IV) Suggest the most suitable transmission medium to connect Mumbai campus with Delhi head office. [1 Mark]
(V) The company is planning to host online video conferences with international clients. Suggest an appropriate protocol for real-time video/voice communication. [1 Mark]
- Admin Block: 110 Computers
- Finance Block: 35 Computers
- Design Block: 25 Computers
- HR Block: 15 Computers
Distances between blocks:
- Admin to Finance: 40 m
- Admin to Design: 120 m
- Admin to HR: 90 m
- Finance to Design: 80 m
- Finance to HR: 150 m
- Design to HR: 70 m
- Mumbai Campus to Delhi Head Office: 1400 kmAnswer the following questions:
(I) Suggest the most suitable block to install the server in the Mumbai campus with suitable justification. [1 Mark]
(II) Suggest the best network device to connect all computers within each block. [1 Mark]
(III) Draw the most economical cable layout to connect all four blocks in Mumbai campus. [1 Mark]
(IV) Suggest the most suitable transmission medium to connect Mumbai campus with Delhi head office. [1 Mark]
(V) The company is planning to host online video conferences with international clients. Suggest an appropriate protocol for real-time video/voice communication. [1 Mark]