Page 1
HALF YEARLY EXAM
QUESTION
PAPER
ORIGINAL EXAM PAPERS
Page 2
HALF YEARLY EXAMINATION, 2024-25
INFORMATICS PRACTICES
Time –3:00 Hrs. Class – XII M.M. : 70
Date – 14.09.2024 (Saturday)
Name of the student _______________________________________________Section _____
General Instructions:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A has 18 questions carrying 01 mark each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
5. Section C has 05 Short Answer type questions carrying 03 marks each.
6. Section D has 02 Long Answer type questions carrying 04 marks each.
7. Section E has 03 questions carrying 05 marks each.
8. All programming questions are to be answered using Python Language only.
SECTION - A (Multiple Choice Based Questions)
Q1 Which of the following is a two - dimensional labelled data structure of Python? [1]
a) Square b) Relation c) Series d) Dataframe
Q2 Which of the following is not Pandas data structure? [1]
a) Queue b) Series c) Data Frame d) Sequence
Q3 Find the output of given code: [1]
import pandas as pd
s=pd.Series([ ’a’,’s’,’r’] , index=[ 2,6,9] )
print(s>=’s’)
a) b) c) d)
2 False 2 False 2 True 2 False
6 False 6 True 6 False 6 False
9 False 9 False 9 True 9 True
Q4 Which attribute of a dataframe is used to get number of axis? [1]
a) Shape b) Ndim c) T d) Empty
Q5 We can delete rows and columns from data frame ResultDF using the method [1]
a) ResultDF.remove() b) ResultDF.terminate()
c) ResultDF.drop() d) ResultDF. delete()
Q6 When we create a DataFrame from a list of Dictionaries the columns labels are formed by the [1]
a) union of the keys of the dictionaries
b) union of the values of the dictionaries
c) intersection of the keys of the dictionaries
d) intersection of the values of the dictionaries
Q7 To get the number of dimensions of a Series object. ________ attribute is displayed. [1]
a) index b) itemsize c) size d) ndim
Q8 In DataFrame, by default new column added as the ________ column. [1]
a) First(Left Side) b) Anywhere in dataframe c) Last (Right Side) d) Second
HALF YEARLY EXAM | IP | CLASS 12 | 2024-25 | PRINTED Q 35 PRINTED PAGES 6| PAGE# 1
Page 3
Q9 Which argument of bar() lets you set the thickness of bar? [1]
a) thick b) thickness c) width d) barwidth
Q10 Ms. Kalpana is working with an IT company and she wants to create charts from the data [1]
provided to her. She generates the following graph:
Which statement is used to mark the line as given in the above graph?
a) plt.plot(x, y, marker=’star’, markersize=10,color=‘black’)
b) plt.plot(x, y, marker=’*’, markersize=10,color=‘black’)
c) plt.plot(x, y, marker=’#’, markersize=10,color=‘black’, linestyle=’dashdot’)
d) plt.plot(x, y, marker=’@’, markersize=10,color=‘black’, linestyle=’dashdot’)
Q11 The datapoints plotted on a graph are called ________. [1]
a) Ticks b) Markers c) Values d) Pointers
Q12 A histogram is used: [1]
a) for time series data b) for grouped data
c) to compare two sets of data d) for continuous data
Q13 The correct statement to read from a CSV file in a dataframe is: [1]
a) = pandas.read() b) .read_csv()() c) .read_csv() d) = pandas.read_csv()
Q14 Assertion (A): We can read specific rows from a CSV file. [1]
Reason (R): The nrows attribute of to_csv() is used to read specific rows from a CSV file.
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.
c) A is true but R is false.
d) A is false but R is true.
Q15 If the substring is not present in a string, the INSTR ( ) returns: [1]
a) NULL b) 1 c) 0 d) - 1
Q16 What will be returned by the given query? [1]
SELECT ROUND(153.669,2);
a) 153.7 b) 153.66 c) 153.6 d) 153.67
Q17 What will be returned by the given query? [1]
SELECT INSTR(’INDIA’, ’DI’);
a) -2 b) -3 c) 3 d) 2
Q18 What will be returned by the given query? [1]
SELECT month(’2020 - 05 - 11’);
a) 11 b) November c) May d) 5
SECTION – B (Very Short Answer Type Questions)
Q19 Write the syntax to sort the series values using indexes in descending order. [2]
OR
Fill in the blank with the correct statement to plot a bar graph using a matplotlib method, so
that Company ABC can see the graphical presentation of its Profit figures for the 2nd quarter
HALF YEARLY EXAM | IP | CLASS 12 | 2024-25 | PRINTED Q 35 PRINTED PAGES 6| PAGE# 2
Page 4
of the financial year 2019 (i.e. August, September, October, November).
import matplotlib.pyplot as mtp
Months = [ ’AUG’, ’SEP’, ’OCT’, ’NOV’] #X Axis
Profits = [ 125, 220, 230, 175] #Y Axis
_________________________________ mtp.show()
Q20 Write a program to create a series to print scalar value "5"four times. [2]
Q21 Write the symbol for following markers: [2]
1. circle 2. vline marker
Q22 What is the use of multiple bar plot? [2]
Q23 Write python code to write DataFrame data into "a.csv"file. [2]
Q24 Predict the output of the following SQL queries from the below Table: SCHOOLTable : [2]
Write the output of the following SQL statements from the given table to:
1. SELECT AVG (Per) FROM SCHOOL WHERE House="Red";
2. SELECT Sname, Per FROM SCHOOL WHERE MONTH (Dob)=11;
Q25 Find the output of the following SQL queries: [2]
1. SELECT MID("YOUNG INDIA",5);
2. SELECT INSTR("MACHINE INTELLIGENCE","IN");
SECTION – C (Long Answer Type Questions)
Q26 Consider the series object srl that stores the salary of teacher, as shown below. Here [3]
Teacher’s name represents by their initial names.
R 15000
K 12000
N 20000
L 22000
Write the code to modify the salary of K as 18000 and for N and L as 25000. Print the
changed Series.
Q27 Consider the following DataFrame dfn that contain vegetables. [3]
HALF YEARLY EXAM | IP | CLASS 12 | 2024-25 | PRINTED Q 35 PRINTED PAGES 6| PAGE# 3
Page 5
Write the code statement to the following:
1. Find all rows with the label Chilli . Extract all columns.
2. List 2nd, 3rd and 4th rows.
3. List only the columns Quantity and Price using loc.
Q28 Consider the following graph. Write the code to plot it. Also label the X and Y axis. [3]
Q29 [3]
Consider the above DataFrame dfn and Write the output of the following statement.
a) dfn.loc [ : ,[ ‘A’, ‘B’]]
b) dfn.loc [ ’Purchase’, :]
c) dfn.iloc[0:2,1:2]
Q30 Help Renu in predicting the output of the following queries. [3]
1. SELECT ROUND(8.72,3);
2. SELECT ROUND(9.8);
OR
What is the difference between the functions DAYNAME() and DAYOFWEEK()?
SECTION – D (Case Study Based Questions)
Q31 Consider the following DataFrame ‘mdf’. [4]
1.
Write Python statements for the DataFrame ‘mdf’:
a. To display the records of the students having roll numbers 2 and 3.
b. To increase the marks of subject Math by 4, for all students.
2. Write Python statement to display the name and Hindi marks for roll no. 2 and 5.
Q32 Vidit wants to plot a bar graph for the given set of values of subject on X-axis and number of [4]
students who opted for that subject on Y-axis.
HALF YEARLY EXAM | IP | CLASS 12 | 2024-25 | PRINTED Q 35 PRINTED PAGES 6| PAGE# 4
Page 6
x=['English','Physics','Chemistry','Mathematics']
y=[12,25,20,35]
The width and colour for each bar should be different.
(width = 0.3, 0.5, 0.7, 0.9, Colour = orange, red, black, yellow)
OR
Consider the following graph. Write the Python code to plot it. Also add the Title and Label
for X and Y axis. Use the following data to draw the graph.
SECTION – E (Very Long Answer Type Questions)
Q33 (i) Write a program in Python Pandas to create the following DataFrame "popData" from [2+3]
a Dictionary:
(ii) Perform the following operations on the DataFrame:
a. Display the columns country and population.
b. Display all the rows where population is more than 40.
c. Delete the last 2 rows.
Q34 a) Write python code to plot the following data using a line plot. [4+1]
Day 1 2 3 4 5 6 7 [5]
Tickets sold 2000 2800 3000 2500 2300 2500 1000
Before displaying the plot display “Monday”, “Tuesday”, “Wednesday”, “Thursday”,
“Friday”, “Saturday” and “Sunday” also in place of Day 1, 2, 3, 4, 5, 6, 7.
b) Change the colour of the line to magenta.
OR
Draw the approximate graph which display the multiline in same plot.
import matplotlib.pyplot as plt
x1 = [ 10,20,40]
y1 = [ 20,50,10]
plt.plot(x1, y1, label = "line 1")
HALF YEARLY EXAM | IP | CLASS 12 | 2024-25 | PRINTED Q 35 PRINTED PAGES 6| PAGE# 5
Page 7
x2 = [ 10,20,30]
y2 = [ 40,10,20]
plt.plot(x2, y2, label = "line 2")
plt.xlabel(’x - axis’)
plt.ylabel(’y - axis’)
plt.title(’Multiline’)
plt.legend()
plt.show()
Q35 Give the output of following commands. [5]
1. mysql>SELECT TRUNCATE (200.91,1);
2. mysql>SELECT LEFT (’Swati’, 4);
3. mysql>SELECT CHAR (83, 72, 85, 67, 72, 73);
4. mysql>SELECT RTRIM(’!!!!! Study is important !!!!!’);
Where !!!!! denotes blank spaces
5. SELECT ROUND(3234.343, 1);
OR
Consider the table DOCTOR given below. Write commands in SQL for (i) to (ii) and output for
(iii) to (v). Table : DOCTOR
1. Display the names and salaries of doctors where DOJ is in the year 1994.
2. Display the first five characters of the department for all the Male doctors.
3. Select Substr (DOCName, 3, 5) from Doctor;
4. Select Monthname (DOJ) from doctor where Salary >= 50000;
5. Select Dayofyear (DOJ) from doctor where Department= ‘Orthopaedics’;
HALF YEARLY EXAM | IP | CLASS 12 | 2024-25 | PRINTED Q 35 PRINTED PAGES 6| PAGE# 6
Page 8
Study Materials
Notes
Model Papers Class 6 Notes
Sample Papers Class 7 Notes
Half Yearly Sample Papers Class 8 Notes
Class 9 Notes
Important Resources
Class 10 Notes
Periodic Table
Class 11 Notes
Writing Skills / Formats
Maps of India / World Class 12 Notes
Books and Solutions
NCERT Books
NCERT Book Solutions
HC Verma Chapter Wise Solutions
RD Sharma Solutions
CGBSE Solutions