10th 11th and 12th Paper
10th 11th and 12th Paper
3. If the following code is executed, what will be the output of the following 1
code?
name="IlovemyCountry"
print(name[3:10])
1
5. Select the correct output of the following code
Fp.seek(5,1)
a) Move file pointer five character ahead from the current postion
b)Move file pointer five character ahead from the beginning of a file
c)Move file pointer five character behind from the current postion
d)Move file pointer five character behind ahead from the end of a file
mystring = “Pynative”
stringList = [ “abc”, “Pynative”,”xyz”]
print(stringList[1] == mystring)
print(stringList[1] is mystring)
a) Ture b) Flase C) 25 D) 0
15. Which portion of the URL below records the directory or folder of the 1
desired resource?
https://www.nishantsingh.com/ghagwal/pgt.htm
a) http b) ghagwal c) www.nishantsingh.com d) pgt.htm
Q17 and Q18 are ASSERTION AND REASONING based questions. Mark the correct choice as
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
17 Assertion (A):- Key word arguments are related to function calls. 1
Reasoning(R ):- When you use keyword arguments in funation call, the caller
identifies the arguments by the parameter name.
18 Assertion(A) : The tell method will stores/get the current location of the file 1
pointer.
Reasoning(R): Python seek method returns the current position of the file
read/write pointer with the file.
Section B
19. Mr. Akash has written a code , His code is having errors , Rewrite the correct code 2
and underline the correction s made.
5x=input(“Enter a number”)
If(abs(x)=x):
Print(“You Entered a positive number..”)
Else:
x=x-1
print(“Number made positive:”x)
21 a) If the following code is executed, what will be the output of the following 1
code?
mystr1 = ‘Sequence with labels’
mystr2 = ‘$’
print(mystr2*6+mystr1+mystr2*5)
1
b) What will be the output of the following code snippet?
init_tuple_a =( 'a', '3’)
init_tuple_b = ('sum', '4')
print (init_tuple_a + init_tuple_b)
27 Assume that a text file named TEXT1.TXT already contains some text written 3
into it ,write a function named COPY(),that reads the file TEXT1.TXT and create a
new file named TEXT2.TXT ,which shall contain only those words from the file
TEXT1.TXT which don’t start with an uppercase vowel(i.e. with ‘A’,’E’,’I’,’O’,’U’)
,for example if the file TEXT1.TXT contains
He can appoint any member of the Lok Sabha
then the file TEXT2.TXT shall contain
He can member of the Lok Sabha
OR
write a function countmy() in python to read the text file "DATA.TXT" and
count the number of times "my" occurs in the file
28 Write the outputs of the SQL queries (i) to (iii) based on the relations VEHICLE 3
and TRAVEL given below:
VCODE VEHICLETYPE PERKM
V01 VOLVO BUS 150
V02 AC DELUX BUS 125
V03 ORDINARY BUS 80
V04 CAR 18
V05 SUV 30
NOTE: PERKM is fright charges per kilometer
Table: TRAVEL
CNO CNAME TRAVELDATE KM VCODE NOP
101 K. Niwal 2015-12-13 200 V01 32
103 Fredrick Sym 2016-03-21 120 V03 45
105 Hitesh Jain 2016-04-23 450 V02 42
102 Ravi Anish 2016-01-13 80 V02 40
107 John Malina 2015-02-10 65 V04 2
104 Sahanubhuti 2016-01-28 90 V05 4
106 Ramesh Jaya 2016-04-06 100 V01 25
NEW DELHI
Head
INDIA Tech
Office
Sales Office
Office
Kolkata
Ahmedabad Coimbat
ore
a) Suggest network type for connecting each of the following set of their offices:
Head Office and Tech Office
Head Office and Coimbatore Office
b) Which device you will suggest to be produced by the company for connecting all the
computers with in each of their offices out of the following device?
i) Switch/Hub ii)Modem iii)Telephone
c) Which of the following communication media, you will suggest to be procured by th
company for connecting their local offices in New Delhi for very effective and fast
communication.
i) Telephone Cable ii) Optical fibre iii) Ethernet cable
d) Suggest a Cable /Wiring layout for connecting the company’s local offices located in
New Delhi . Also, suggest an effective method /technology for connecting the company
‘s regional office at “Kolkata”,”Coimbatore and “Ahmedabad”.
32 Write a function in python, PushEl(element) and MakeEl(element) to add a new 5
element and delete a element from a List of element Description, considering
them to act as push and pop operations of the Stack data structure .
Or
Write a function in Python PUSH(A), where A is a list of numbers. From this list
push all even numbers into a stack implemented by using a list. Display the stack
if it has at least one element, otherwise display appropriate error message
33 Write a function countVowels() in Python, which should read each character of a 5
text file
“myfile.txt”, count the number of vowels and display the count.
Example:If the “myfile.txt” contents are as follows:
This is my first class on Computer Science.
The output of the function should be: Count of vowels in file: 10
Section E
Table: MobileStock
S_Id M_Id M_Qty M_Supplier
S001 MB004 450 New Vision
S002 MB003 250 Praveen Gallery
S003 MB001 300 Classic Mobile Store
S004 MB006 150 A-one-Mobiles
S005 MB003 150 The Mobile
S006 MB006 50 Mobile Centre
i) Display the Mobile company, Mobile Name & Price in descending order of their
manufacturing date.
ii) List the details of mobile whose name starts with s
iii) Display the mobile supplier and quantity of all mobiles except MB003.
iv) Display the name of mobile company having price between 3000 and 5000
v) Display the name of company, supplier and Price by joining the joining the two
tables where price is more than 5000.
35 Pushpa writing a program to create a CSV file “item.csv” which will contain item 5
name, Price and quantity of some entries. He has written the following code. As
a programmer, help him to successfully execute the given task.
import # Line
def addInCsv(item,price,qty): # to write / add data into the CSV file
f=open(' item.csv',' ') # Line
csvFileWriter = csv.writer(f)
csvFileWriter.writerow([item,price,qty])
f.close()
#csv file reading code
defreadFromCsv(): # to read data from CSV file
with open(' item.csv','r') as csvFile:
newFileReader = csv. (csvFile) # Line
for row in newFileReader:
print (row[0],row[1],row[2])
csvFile. # Line
addInCsv('Note Book',45,100)
addInCsv('Text Book',60,150)
addInCsv('Ball Pen',10,100)
addInCsv('Pencil', 5,200)
readFromCsv() #Line
(a) Name the module he should import in Line 1.
(b) In which mode, Pushpa should open the file to add data into the file
(c) Fill in the blank in Line 3 to read the data from a csv file.
(d) Fill in the blank in Line 4 to close the file.
(e) Write the output he will obtain while executing Line 5.
SAMPLE PAPER SET-11
Class: XII Session SUBJECT : Compute
Science(083) TIME : 3 HOURS MM : 70
General Instructions:
SECTION A
1. State True or False 1
The value of the expression 5/(6*(4-2)) and 5/6*(4-2) is the same.
2. Which of the following is the data type of value, returned by input( ) method in 1
Python?
(a ) Boolean (b) String (c) Int (d) Float
3. Given the following dictionaries 1
Dict1={‘Tuple’:’immutable’,’List’:’mutable’,’Dictionary’:’mutable’,’String’:’immu
table’}
Which of the following will delete key:value pair for key=‘Dictionary’ in the
above mentioned dictionary?
a. del Dict1[‘Dictinary’]
b. Dict1[‘Dictionary’].delete( )
c. delete (Dict1.[“Dictionary”])
d. del(Dict1.[‘Dictionary’])
4. Consider the given expression: 1
print(2**5+8//3*7-2)
Which of the following will be correct output if the given expression evaluated?
(a) 44
(b) 34
(c) 42
(d) 36
(A) 0
(B) 2
(C) 1
(D) Error
15 All aggregate function except ignore NULL values in order the 1
produce the output.
(A) AVG( )
(B) COUNT( )
(C) COUNT(*)
(D) TOTAL( )
16 To establish a connection between Python and SQL database, connect() 1
method is used. Identify the correct syntax of connect( ) method from the
followings.
(A) Connect(user=”user name”, passwd=”password”, host=”host
name”, database= “database name”)
(B) Connect(host=”host name”, user=”user name”,
password=”password”, database= “database name”)
(C) Connect(host=”host name”, user=”user name”, passwd=”password”,
database= “database name”)
(D) Connect(host=”host name”, database= “database name”, user=”user
name”, password=”password”)
Q17 and 18 are ASSERTION AND REASONING based Questions. Mark the correct choice as
(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 and R is False.
(D) A is False and R is True.
17 Assertion (A) : A function is a block of organized and reusable code that is used 1
to perform a single related action.
Reason (R) : Function provides better modularity for your application and a
high degree of code reusability.
18 Assertion (A) : Text file stores information in ASCII or Unicode characters. 1
Reason (R) : CSV stands for comma separated value. These files are common
file format for transferring and storing data.
SECTION B
19 Anshika has written a code to calculate the factorial value of a number, but her 2
code is having some errors. Rewrite the correct code and underline the
corrections made.
def Factorial(Num)
1=fact
While num=>0:
fact=fact*num
num=-1
print(“Factorial value is =”,fact)
20. Differentiate between Viruses and Worms in context of networking and data 2
communication threats.
OR
Differentiate between Web server and web browser. Write any two popular
web browsers.
21 (A) Given is a Python List declaration : 1
L1=[11,23,16,28,55,37,61,89]
write the output of the code given below
: print(L1[-3:8])
(B) Given is a Python Dictionary : 1
Lib={“Novel”:152,”Magzine”:20,”Newspaper”:10,”Books”:250}
Write Python statement to delete key:value pair for key=”Novels”.
22 What is the difference between UNIQUE and PRIMARY KEY constraints in an 2
RDBMS.
23 (A) Expand the following terms :- 1
(I) FTP (II) GSM
(B) Danish has to share the data among various computers of his two offices 1
branches situated in the same city. Name the type of network which is being
formed in this process.
24 Predict the output of the Python code given below: 2
def Update(str1):
length=len(str1)
temp=""
for i in range(0, length):
if str1[i].islower():
temp=temp+str1[i].upper()
elif str1[i].isupper():
temp=temp+str1[i].lower()
elif str1[i].isdigit():
temp=temp+str(int(str1[i])+1)
else:
temp=temp+'#'
print(temp)
Update("CBSE-2023 Exams")
OR
Mydict={}
Mydict[(1,2,3)]=12
Mydict[(4,5,6)]=20
Mydict[(1,2)]=25
total=0
for i in Mydict:
total=total+Mydict[i]
print(total)
print(Mydict)
25 Define the following terms in context with RDBMS:- 2
(I) Degree (II) Cardinality
OR
Write the full form of DDL and DML. Also write any two examples of DDL and
DML.
SECTION C
DEPARTMENT
Ecode Department
M01 Marketing
S01 Sales
A05 Accounts
H03 HR
What will be the output of the following statement?
SELECT E.Ecode,E.Ename,D. Department FROM EMPLOYEE E,
DEPARTMENT D WHERE E.Ecode = D.Ecode;
(B) Write the output of the queries (i) to (iv) based on the table PRODUCT and
CUSTOMER given below :
PRODUCT
P_ID P_Name Manufacturer Price Discount
TP01 Talcum Powder LAK 40
FW05 Face Wash ABC 45 5
BS01 Bath Soap ABC 55
SH06 Shampoo XYZ 120 10
FW12 Face Wash XYZ 95
CUSTOMER
C_ID C_Name City P_ID
01 Cosmetic Shop Delhi TP01
02 Total Health Mumbai FW05
03 Live Life Delhi BS01
04 Pretty Woman Delhi SH06
05 Dreams Delhi TP01
i. SELECT P_Name, count(*) FROM Product GROUP BY P_Name;
Example :
If the file contents are as follows:-
OR
Write a method COUNT_WORD()in Python to read lines from a text file
“PLEDGE.TXT” and count and display the occurrences of the word “country” in
the file.
Example :-
If the content of the file are as follows :-
India is my country and all Indians are my brothers and sisters. I love my country
and I am proud of its rich and varied heritage. I shall always strive to be worthy
of it.
I shall give respect to my parents, teachers and elders and treat everyone with
courtesy.
To my country and my people, I pledge my devotion. In their well being and
prosperity alone, lies my happiness.
The COUNT_WORD() function should display the output as :
Total Occurrences of word “country” = 3
28 (A) Write the outputs of the SQL queries (i) to (iv) based on the relations CAR 2+1
and OWNER given below:-
CAR
C_code Carname Make Color Capacity Charges
501 Ignis Suzuki Blue 5 14
503 Saltoz Tata White 5 16
502 Innova Toyota Silver 7 18
509 SX4 Suzuki Black 5 20
510 NIOS Hyundai Grey 5 15
CUSTOMER
C_Id Cname C_code
1001 Vansh Sharma 501
1002 Shivanand 509
1003 Tanish Sharma 503
1004 Palak 502
(i) SELECT COUNT(DISTINCT Make) FROM CAR;
(ii) SELECT MAX(Charges), MIN(Charges) FROM CAR;
(iii) SELECT COUNT(*), Make FROM CAR;
(iv) SELECT Carname FROM CAR WHERE Capacity=7;
(B) Write SQL Command to show the list of all the databases.
(i) What will be the most appropriate block, where RSC should plan to 1
house the server?
(ii) Suggest the cable layout to connect al the buildings in the most 1
appropriate manner for efficient communication.
(iii) What will the best suitable connectivity out of the following to 1
connect the offices in Bangalore with its New York based office.
(a) Infrared (b) Satellite Link (c ) Ethernet Cable
(iv) Suggest the placement of the following devices with justification.
(a) Hub / Switch (b) Repeater 1
(v) Which service / protocol will be most helpful to conduct the live
interactions of Experts from New York to Human Resource Block. 1
32 (A) Write the output of the Python code given below 2+3
: a=10
def fun(x=10,y=5):
global a
a=y+x-3
print(a,end="@")
i=20
j=4
fun(i,j)
fun(y=10,x=5)
(B) The code given below inserts th following record in the table Employee:
ECode – Integer
EName – String
Deptt – String
Salary – Float
Note the following to establish connectivity between Python and MYSQL :
Username is admin
Password is Hello123
Database is KVS
The Department of the employee will be entered by the user in order
to get the list of employees in the department.
Write the following missing statements to complete the code:
Statement 1 – To form the cursor object.
Statement 2 – To execute th command that searches for the employee code in
the table Employee.
Statement 3 – To show all the records returned by the query.
import mysql.connector as con
def Emp_data():
mycon=con.connect(host=”localhost”,user=”admin”,passwd=”Hello123
”,database=”KVS”)
mycursor= # Statement 1
Dept=input(“Enter Department name to be searched for =”)
Qry_Str=”Select * from Employee where deptt=”+Dept
# Statement 2
Mydata= # Statement 3
for row in Mydata:
print(row)
mycon.close()
OR
(A) Predict the output of the code given below:
x=[1,2,3]
ctr=0
while ctr<len(x):
print(x[ctr]*’#’
for y in x:
print(y*’$ ‘)
ctr+=1
(B) The code give below reads the following record from the table
named “SALES” and update those records who have Sale>50000 in
order to provide commission 4% of Sale amount.
Scode – integer
Sname- String
Saleamt – Float
Commission – Float
Note the following to establish conectivity between Python and MySQL :
Username is root
Password is Scott
Database Name : Company
Write the following missing statements to complete the code :
Statement 1 – to form the cursor object
Statement 2 – to execute the query to update the commission column as 4% of
Saleamount for those records only who have Sale>50000.
Statement 3 – to add the data parmanently in the database.
OR
34. Karan creates a table GAMES with a set of records to store the details of Games 1+1+2
like Name of Game, Type of Game, Prize Money etc. as given below. After
creation of the table, he has entered some records as shown below :
GCode GName Type PrizeMoney ScheduleDate
101 Badminton Outdoor 15000 10-Oct-2021
102 Chess Indoor 20000 01-JUL-2020
103 Table Tennis Indoor 10000 01-Mar-2022
104 Carom Board Indoor 8000 15-AUG-2023
105 Cricket Outdoor 25000 01-DEC-2022
SECTION-A
Q.1 Which of the following are in-valid operators in 1
Python? (A) += (B) ^ (C) =+ (D) &&
Q.2 Which function is used to remove the given characters from trailing end i.e. right end of a string? 1
(A) strip( ) (B) remove( ) (C) lstrip( ) (D) rstrip( )
Q.3 Predict the output of following python 1
code. SS="PYTHON"
print( SS[:3:])
(A) THON (B) PYT (C) PYTH (D) HON
Q.4 A Python List is declared as Stud_Name = ['Aditya', 'aman', 'Aditi','abhay'] 1
What will be the value of min(Stud_Name)?
(A) abhay (B) Aditya (C) Aditi (D) aman
Q.5 Choose the correct output of following 1
code: Tup=(100)
print(Tup*3)
(A) (300,) (B) (100,100,100) (C) Syntax Error (D) 300
Q.6 In a stack, if a user tries to remove an element from empty stack it is called 1
(A) Underflow (B) Empty (C) Overflow (D) Blank
Q.7 Which method is used for object serialization in Python? 1
(A) Pickling (B) Un-pickling (C) Merging (D) None of the above
Q.8 Which types of arguments/parameters supports by Python? 1
PS-SP-QP-XII-CS-22-23 1 | Page
(A) Positional Argument (B) Default Arguments
(C) Keyword (or named) Arguments (D) All of Above
Q.9 If a function in python does not have a return statement, which of the following does the function 1
return?
(A) int (B) float (C) None (D) Null
Q.10 A is a set of rules that governs data communication. 1
(A) Forum (B) Protocol (C) Standard (D) None of the above
Q.11 Select correct collection of DDL Command? 1
(A) CREATE, DELETE, ALTER, MODIFY (B) CREATE, DROP, ALTER, UPDATE
(C) CREATE, DROP, ALTER, MODIFY (D) CREATE, DELETE, ALTER, UPDATE
Q.12 Which statement is used to display the city names without repetition from table Exam? 1
(A) SELECT UNIQUE(city) FROM Exam; (B) SELECT DISTINCT(city) FROM Exam;
(C) SELECT PRIMARY(city) FROM Exam; (D) All the above
Q.13 Ronak want to show the list of movies which name end with ‘No-1’. Select the correct query if table 1
is MOVIE and field attribute is Movie_Name.
(A) SELECT Movie_Name FROM MOVIE WHERE Movie_Name = ‘%No-1’;
(B) SELECT Movie_Name FROM MOVIE WHERE Movie_Name = ‘No-1%’;
(C) SELECT Movie_Name FROM MOVIE WHERE Movie_Name LIKE ‘%No-1’;
(D)SELECT Movie_Name FROM MOVIE WHERE Movie_Name LIKE ‘No-1%’;
Q.14 Which Constraint not allow to enter repeated values in the table? 1
(A)PRIMARY KEY (B) UNIQUE (C) BOTH A and B (D) None of
above
Q.15 COMMIT command is belongs to 1
(A)DDL Command (B) DML Command (C) TCL Command (D) None of the above
Q.16 Which function is used to create a cursor in Python – SQL connectivity? 1
(A)fetch() function (B) execute() function (C) connect() function (D) curse()
function
Q17 and 18 are ASSERTION AND REASONING based questions. Mark the correct choice as
(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
Q.17 Assertion (A):- In stack, program should check for Underflow condition, before executing the pop 1
operation.
Reasoning (R):- In stack, underflow mean there is no element available in the stack or stack is an
empty stack.
Q.18 Assertion (A):- The readlines() method in python reads all lines from a text file. 1
Reasoning (R):- The readlines() method returns the tuple of lines(string).
SECTION-B
Q.19 A student has written a code to print a pattern of even numbers with equal intervals. His code is 2
having errors. Rewrite the correct code and underline the corrections made.
def pattern(start=0, end, interval):
PS-SP-QP-XII-CS-22-23 2 | Page
for n in range(start: end, interval):
if(n%2==1):
print(n)
else
pass
x=int(input("Enter Start Number: "))
y=int(input("Enter End Number: "))
z=int(input("Enter Interval: "))
pattern(x,y,z)
Q.20 (A) line="T-20 Cricket World Cup 2022" 2
x=line[::-1]
print(a[0:4:1][::-1])
(B)
India={"Animal":"Tiger","Bird":"Peacock","Flag":"Tri-Color"}
India["Capital"]="New Delhi"
print(India.values())
Q.21 Find and write the output of the following python code: 2
def Alter(P=15,Q=10):
P=P*Q
Q=P/Q
print(P,"#",Q)
return Q
A=100
B=200
A=Alter(A,B)
print(A,"$",B)
B=Alter(B)
print(A,"$",B)
Q.22 Write full form on given abbreviation 2
(i) URL
(ii) SMTP
Q.23 Explain the difference between webpage and website with examples of each. 2
OR
What is the difference between Packet Switching and Circuit Switching?
Q.24 What is the role of connect() and rowcount() methods in python. 2
Q.25 What is the importance of UNIQUE constraints in a table? Give a suitable example. 2
OR
Explain the terms degree and cardinality with example in reference to table.
SECTION-C 2
Q.26 Write a method COUNT_WORDS() in Python to read text file ‘STUDENT.TXT’ and display the
total number of Words in the file which start with ‘S’ and end with ‘R’.
your output should shown like given below:
No. of word found: …….
Q.27 Write definition of a function How_Many(List, elm) to count and display number of times the value 3
of elem is present in the List. (Note: don’t use the count() function)
For example :
If the Data contains [205,240,304,205,402,205,104,102] and elem contains 205
The function should display 205 found 3 Times
PS-SP-QP-XII-CS-22-23 3 | Page
Q.28 Write PUSH_CITY(cities) and POP_CITY(cities) methods/functions in Python to add new city name 3
and delete city name from a List of cities, considering them to act as push and pop operations of the
Stack data structure.
OR
Write a function in Python PUSH_VAL(val), where val is a list of numbers. From this list push all
odd numbers into a stack implemented by using a list. Display the stack if it has at least one element,
otherwise display appropriate messages.
Q.29 Consider the following tables SCHOOL and ADMIN and answer this question :
Give the output the following SQL queries :
PS-SP-QP-XII-CS-22-23 4 | Page
PS-SP-QP-XII-CS-22-23 5 | Page
Q.30 Write a output for SQL queries (i) to (iii), which are based on the table: SCHOOL and ADMIN given 3
below:
TABLE: SCHOOL
PS-SP-QP-XII-CS-22-23 6 | Page
Distances between various wings are given below:
Wing A to Wing S 100m
Wing A to Wing J 200m
Wing A to Wing H 400m
Wing S to Wing J 300m
Wing S to Wing H 100m
Wing J to Wing H 450m
Number of Computers installed at various wings are as follows:
Wings Number of Computers
Wing A 20
Wing S 150
Wing J 50
Wing H 25
(a) Suggest the best-wired medium and mention the topology or layout to connect
various wings of Excel Public School, Coimbatore.
(b) Name the most suitable wing to house the server. Justify your answer.
(d) Suggest a device that can provide wireless Internet access to all smartphone/laptop
users in the campus of Excel Public School, Coimbatore.
(e) What should be the Network Topology among all blocks of the organization :
(a) LAN (B) MAN (c) WAN (IV) Any of these
Q.32 (A). Write the output of following Python code. 2
def change(): +
Str1="WORLD-CUP2022" 3
Str2=""
I=0
while I<len(Str1):
if Str1[I]>="A" and Str1[I]<="M":
Str2=Str2+Str1[I+1]
elif Str1[I]>="0" and
Str1[I]<="9": Str2=Str2+
(Str1[I-1])
else:
Str2=Str2+"*"
I=I+1
print (Str2)
change():
PS-SP-QP-XII-CS-22-23 7 | Page
PS-SP-QP-XII-CS-22-23 8 | Page
(B). The code given below extract the following record in from the table Emp whose salary is more
than Rs. 50000:
EmpNo – integer
EmpName – string
Age– integer
Salary – integer
Note the following to establish connectivity between Python and MYSQL:
∙ Username is root
∙ Password is tiger
∙ The table exists in a MYSQL database named BIG_COMPANY.
∙ The details (EmpNo, EmpName, EmpAge and EmpSalary) are to be accepted from the
user. Write the following missing statements to complete the code:
Statement 1 – To create the cursor object
Statement 2 – To execute the command that extract the records of those employees whose salary is
greater than Rs. 50000.
Statement 3 -- To store records from cursor to an object named EmpRecord.
import mysql.connector as cntr
def Emp_Big_Company():
con=cntr.connect(
host="localhost",
user="root",
password="tiger",
database="big_company")
EmpCursor= # Statement 1
print("Display Employee whose salary is more than Rs. 50000:")
# Statement 2
EmpRecord= #Statement 3
for record in EmpRecord:
print(record)
Q.33 (A) Write any two difference between text file and binary file?
(B) Write a Program in Python that defines and calls the following user defined functions:
Add_Book():
To accept data of new book and add to ‘library.csv’ file. The record of book consists
book_id, book_name and book_price in form of python list.
Show_Book():
To read the records of books from ‘library.csv’ file and display the record of books
which price is more than Rs. 500.
SECTION-E
Q.34 Lovepreet is a senior clerk in a MNC. He creates a table salary with a set of records to keep ready for 4
tax calculation. After creation of the table, he has entered data of 5 employees in the table.
Add_New_Product()
Show_Product()
PS-SP-QP-XII-CS-22-23 10 |
Page
PS-SP-QP-XII-CS-22-23 11 |
Page