Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

SAMPLE QUESTION PAPER 1

CLASS XII
INFORMATICS PRACTICES (065)
TERM 1
Maximum Marks: 35 Time Allowed: 90 Minutes
General Instructions:
1. The question paper is divided into 3 Sections —A, B and C.
2. Section A consists of Questions 1 to 25 and students need to attempt 20 questions.
3. Section B consists of Questions 26 to 49 and students need to attempt 20 questions.
4. Section C consists of Questions 50 to 55 and students need to attempt 5 questions.
5. All questions carry equal marks.

 Section A
Section A consists of 25 questions. Attempt any 20 questions.
1. Library used for data manipulation and analysis.
(i) NumPy (ii) Pandas
(iii) Math (iv) Round
2. Which module will be installed as part of the Pandas installation?
(i) NumPy (ii) Pygame
(iii) Tkinter (iv) All of the above
3. Which statement will allow you check on the shell prompt to know whether Pandas has been installed or
not?
(i) pip install pandas (ii) import pandas
(iii) import numpy (iv) pip install numpy
4. Which of the following data structures can be used to store one-dimensional data in Pandas?
(i) DataFrame (ii) Series
(iii) Matplotlib (iv) Table
5. The default data type of an empty Series is _________ .
(i) String (ii) Integer
(iii) Object (iv) Float
6. In a Series object, the index must be of ___________ length as elements.
(i) Different (ii) Same
Sample Question Paper 1
(iii) Lower (iv) None of the above
7. Which of the following charts displays information as a series of data points connected by a straight line?
(i) Pie Chart (ii) Scatter Chart
(iii) Line Chart (iv) Bar Chart
8. Which of the following libraries is used for data visualization?
(i) Numpy (ii) Pandas
(iii) Matplotlib (iv) All of the above
9. Which function/method is used to delete rows from the dataframe?
(i) clear() (ii) drop()
(iii) delete() (iv) remove
10. The default graph produced by plt.plot() function is:
(i) Pie chart (ii) Bar Chart
(iii) Line Chart (iv) Column Chart
A.1
11. Which of the following is not an activity of active digital footprint?
(i) Sharing a Facebook post on getting a new job.
(ii) Sending an e-mail invitation to your friends on your birthday.
(iii) Identifying your IP address and location by the web server while browsing.
(iv) Congratulating your friend on Twitter on receiving good marks.
12. Rahul, owner of a movie parlour, produces and sells pirated CDs and DVDs to his customers. Identify the
type of activity he is engaged in.
(i) Ethical hacking (ii) Helping people showing new movies
(iii) Identity theft (iv) Cybercrime
13. Which of the following statements about Shareware software is false?
(i) Shareware software is the same as FOSS software.
(ii) Shareware does not include source code.
(iii) Shareware does not include complete functioning.
(iv) Licensing fee must be paid after a certain period of time in order to access this software.
14. Which of the following is/are attribute(s) of a dataframe?
(i) Size (ii) Shape
(iii) Ndim (iv) All of the above
15. Which of the following actions falls under the category of trademark infringement?
(i) Selling dosas at your restaurant.
(ii) Manufacturing shoes in your factory and selling them with Adidas label.
(iii) Selling branded products at your shop.
(iv) Sharing links of YouTube videos created by others with your friends.
16. Which of the following cases represents plagiarism?
(i) Providing reference and giving credit to the source.
(ii) Using someone’s exact words in quotes and giving in-text citations.
(iii) Copying content from the internet and pasting it directly into your document.
(iv) Citing the authors’ names and providing a link to the website from where you obtained the content
for your project.
17. While adding values for the new column in the dataframe, if the values are not equal to the number of
rows, which type of error will it raise?
Informatics Practices with Python–XII

(i) KeyError (ii) RuntimeError


(iii) NameError (iv) ValueError
18. Which of the following is not one of the three basic requirements for granting an innovation patent?
(i) It should be a new invention.
(ii) It should have the capability to be used in industrial application.
(iii) It should only be a product.
(iv) None of the above
19. Identify the command to display last 5 rows of the dataframe.
(i) Df1.head(5) (ii) Df1.last(5)
(iii) Df1.bottom(5) (iv) Df1.tail(5)
20. Following are the precautions to be taken before selling your e-waste. Identify the odd one.
(i) Format all your personal information from the device.
(ii) Contact only authorized recyclers.
(iii) Take out the batteries from the gadgets.
(iv) Destroy every component of the device.
21. Janhvi is confused about the term ‘Digital footprints’. Help her understand it.
(i) It is the time you spend on the computer.
(ii) It is the cost of electricity you consume while being online.
A.2
(iii) The digital traces of all activities you leave on the internet.
(iv) It is like digital signature.
22. Which of the following is not a type of cybercrime?
(i) Data theft (ii) Identity theft
(iii) Damage to data (iv) Installing antivirus for protection
23. Consider a code
df=pd.DataFrame([2,4,5,9],index=[True,False,False,True])
Which of the following is used to create the above dataframe?
(i) Created using Series (ii) Created using List of Dictionary
(iii) Created using Boolean indexing (iv) Created using Strings
24. CSV stands for:
(i) Common Standard Values (ii) Comma Semicolon Values
(iii) Comma Separated Values (iv) Comma Spreadsheet Values
25. Which of the following functions is used to find total rows in a dataframe?
(i) length() (ii) len()
(iii) size() (iv) count()

 Section B
Section B consists of 24 Questions (26 to 49). Attempt any 20 questions.
26. Write the command in the blank to obtain the given output:
import pandas as pd
a=[10,20,30,40]
s1= _____________________
print(s1)
Output:
One 10
Two 20
Three 30
Four 40
(i) pd.Series(a,index=['One','Two','Three','Four'])
(ii) pd.Series(a=['One','Two','Three','Four'],index)
(iii) pd.Ser(a,index=['One','Two','Three','Four'])
(iv) Create Series(a,index=['One','Two','Three','Four'])
27. Assuming the given series, named Salary, which command will be used to increase 2000 in every Sample Question Paper 1
employee’s salary?

Om 35000
Vinay 35000
Samiksha 50000
Nitin 54000
Nandita 60000
dtype: int64
(i) Salary*2000 (ii) Salary.add(2000)
(iii) Salary+2000 (iv) Salary.count()

A.3
28. Ananya wants to store her Term-I marks in a Series which is already stored in a NumPy array. Choose the
statement which will create the series with Subjects as indexes and Marks as elements.
import pandas as pd
import numpy as np
Marks =np.array([30,32,34,28,30])
subjects = ['English','Maths','Chemistry','Physics','IP']
Series1= _______________________________
(i) pd.Series(Marks,index=subjects)
(ii) pd.Series(np.Marks,index=subjects)
(iii) PD.Series(index=Marks, subjects)
(iv) Pd.Series(Marks,index)
29. ______________ is a security device that can help protect your network by filtering traffic and blocking
outsiders from gaining unauthorized access to private data on your computer.
(i) Protocol (ii) Firewall
(iii) Cracker (iv) Spam Filter
30. Observe the following figure and code. Complete the code to obtain this graph as output.


import matplotlib.pyplot as plt
import numpy as np
y= [5,10,12,8,13,17,19,20]
x= range(0,8)
Informatics Practices with Python–XII

(i) plt.plot(x,y,'x',markersize=5, markeredgecolor='r')


plt.show()
(ii) plt.bar(x,y,'x',markersize=5, markeredgecolor='r')
plt.show()
(iii) plt.plot(x,y,'o',markersize=5, markeredgecolor='r',linestyle=’dashed’)
plt.show()
(iv) plt.plot(x,y,'x',markersize=5, markeredgecolor='r',linestyle=’solid’)
plt.show()
31. Consider the two statements given below:
Statement 1: Legends are the different colours that identify different sets of data plotted on the graph.
Statement 2: We can use label argument to give a specific label (text) to data range and legend()
function to specify the location of the legend on the graph.
(i) Both statements are correct.
(ii) Both statements are incorrect.
(iii) Statement A is correct but Statement B is incorrect.
(iv) Statement A is incorrect but Statement B is correct.

A.4
32. Which of the following statements is incorrect regarding graph in matplotlib?
(i) The scatter plot can be created using plot() and scatter() functions of pyplot module.
(ii) A bar chart is created using bar() and barh() functions of pyplot module.
(iii) A line chart is created using line() function of pyplot module.
(iv) A histogram plot is created using hist() function of pyplot module.
33. Lakshya wants to edit an image on his system. Suggest him a free image editing software that can be
downloaded from the internet.
(i) Paint (ii) Photoshop
(iii) GIMP (iv) Microsoft Edge
34. Consider the following statements regarding sending of emails.
Statement 1: Write your personal information such as name, bank account number, credit cards details,
etc.
Statement 2: Be respectful and use appropriate greetings such as Hi, Hello, Dear, etc.
Statement 3: Use emoticons as often as possible instead of text.
Statement 4: Use suitable closing phrases such as Regards, Sincerely, etc.
Identify the correct statements.
(i) Statement 1 and 4 (ii) Statement 2 and 4
(iii) Statement 3 and 4 (iv) Statement 1 and 2
35. Consider a Series ‘numbers’:
a 20
b 30
c 10
d 40
e 50
dtype: int64
What will be the output of the following commands?
print(numbers['e':'b':-2]-5)
(i) e 45
c 5
(ii) a 20
c 10
(iii) c 5
e 45
(iv) Error
36. Which of the following acts is not considered as cyber bullying? Sample Question Paper 1
(i) Harassing a user over instant messaging sessions.
(ii) Circulating rumours about another on social networking sites.
(iii) Posting derogatory messages on a user’s social networking pages.
(iv) Playing online games on the internet.
37. What is the correct syntax to rename columns [Name] to [EmpName] in a dataframe Emp?
(i) Emp.rename={Name:EmpName}
(ii) Emp.rename(index={‘Name’:’EmpName’}, inplace=True)
(iii) Emp.rename(columns={'Name’:’EmpName’},inplace=True)
(iv) Emp.Changename(columns={‘Name’:’EmpName’},inplace=True)
38. Which of the following is not an example of e-waste?
(i) Discarded smartphones, laptops, etc. (ii) Broken computer monitors, LCDs, etc.
(iii) Leftover food (iv) Non-functioning keyboards, printers, etc.

A.5
39. Identify the incorrect statement:
(i) To get the number of elements, size attribute can be used.
(ii) The axis 0 represents rows of a dataframe.
(iii) loc() function is used to extract row/column from the dataframe.
(iv) Missing data in Pandas object is represented as None.
40. What will be the output of the following code?
import pandas as pd
S1=pd.Series([2,4,5,9],index=[True,False,False,True])
S2=pd.Series([10,5,5,1],index=[1,0,0,1])
print(S1+S2)
(i) True 12
0 10
0 10
True 2
dtype: int64
(ii) 1 20
0 20
0 25
1 9
dtype: int64
(iii) True 12
False 9
False 10
True 10
dtype: int64
(iv) True NaN
False NaN
False NaN
True NaN
1 NaN
0 NaN
0 NaN
Informatics Practices with Python–XII

1 NaN
dtype: int64
41. Why shouldn’t e-mails be drafted in capital letters?
(i) Using all capital letters implies a lot of emphasis or shouting.
(ii) It implies that the sender is unfamiliar with netiquette.
(iii) It strains the eyes and makes reading difficult.
(iv) All of the above.
42. Which of the following commands will delete the row ‘SSt’ from the dataframe ‘Final’?
UT1 UT2
Eng 15 19
Hin 19 17
Math 17 16
Sci 15 12
SSt 14 18
(i) Final.drop(['SSt'],axis=0)
(ii) Final.SSt.drop()
(iii) Final.drop(['SSt'],axis=1)
(iv) Final.drop(‘SSt’)
A.6
43. Write the output of the given command:
import pandas as pd
marks= [356,401,488,392,410]
name= ["Shristi",'Aarti','Pardeep','Sunil','Rahul']
stud = pd.Series(marks,index=name)
print(stud[stud>400].sort_values())
(i) Aarti 401
Rahul 410
Pardeep 488
dtype: int64
(ii) Aarti 401
Pardeep 488
Rahul 410
dtype: int64
(iii) Shristi 356
Sunil 392
dtype: int64
(iv) Pardeep 488
Rahul 410
dtype: int64
44. Nikita is working in an IT company. She is trying to store details of 5 employees in a dataframe. She has
collected data and stores it in different lists but is facing problem in creating a dataframe. She has given
the following command but is not getting the desired output. Help her.
import pandas as pd
EmpName=['Rohit','Vinay','Sahil','Kailash','Dipika']
Desig=['Manager','Sales Head','IT Manager','Markeing head','Admin Head']
Salary =[50000,40000,70000,55000,35000]
data={EmpName,Desig,Salary}
Record=pd.DataFrame(data)
print(Record)
(i) data=['Name':EmpName,'Designation':Desig,'Salary':Salary]
(ii) data={Name:EmpName,Designation:Desig,Salary:Salary}
(iii) data={'Name':EmpName,'Designation':Desig,'Salary':Salary}
(iv) data={EmpName,Desig,Salary}
45. Which of the following statements is false regarding OSS?
(i) Its source code is available.
(ii) Its source code is editable.
(iii) It can be distributed only 10 times. Sample Question Paper 1
(iv) It comes with a free or nominal charge.
46. Which of the following dataframe structures will be correct for the given output?
print(Days.size)
Output : 6
(i) Sale1 Sale 2
Day1 10 12
Day2 20 10
Day3 20 10
(ii) Sale1 Sale 2 Sale3
Day1 10 12 12
Day2 20 10 12
Day3 20 10 12

A.7
(iii) Sale1 Sale 2 Sale 3
Day1 10 12 12
Day2 20 10 12
(iv) Both (i) and (iii)
47. Consider the given dataframe ‘Record’ and identify the output of the given command:
Record
Name Age Dose1 Dose2
0 Rakshi 28 June September
1 Rahul 30 June September
2 Chetan 46 July October
3 Shagun 38 May August
4 Charu 36 August November
print(Record.loc[2:4,'Name'])
(i) 2 Chetan
3 Shagun
Name: Name, dtype: object
(ii) 2 Chetan
3 Shagun
4 Charu
Name: Name, dtype: object
(iii) Name Age Dose1 Dose2
2 Chetan 46 July October
3 Shagun 38 May August
4 Charu 36 August November
(iv) Name Age Dose1 Dose2
2 Chetan 46 July October
3 Shagun 38 May August
48. Consider the following dataframe ‘Rank’:
Rank
Informatics Practices with Python–XII

Name Marks Rank


Student1 Aisha 90.0 I
Student2 Amisha 82.0 II
Student3 Jai NaN NaN
Identify the output of the following command:
print(Rank.Marks>80)
(i) Student1 True
Student2 True
Student3 False
Name: Marks, dtype: bool
(ii) Student1 True
Student2 True
Student3 True
Name: Marks, dtype: bool
(iii) Student1 False
Student2 False
Student3 False
Name: Marks, dtype: bool
(iv) Error
A.8
49. Consider the two statements given below:
Statement 1: The missing data in Pandas is represented by NaN.
Statement 2: NaN is equivalent to 0.
(i) Both statements are true.
(ii) Both statements are false.
(iii) Statement 1 is true but Statement 2 is false.
(iv) Statement 2 is true but Statement 1 is false.

 Section C
Case Study Based Questions
Section C consists of 6 Questions (50 to 55). Attempt any 5 questions.
Ms. Nandini is working in a school as an IT head. She has been assigned the task to analyze the performance
of the students of Class X. She has written a snippet for maintaining student details using a dataframe for all
the classes but is facing some problem with it. Help her to rectify the code so as to obtain the desired results.
import pandas as pd
StuName=['Kirti','Gunjan','Neetu','Pranjal','Kamal']
AdmNo=[101,102,103,104,105]
Eng=[87,76,68,90,88]
Hindi=[80,79,75,59,60]
Maths=[90,76,66,78,86]
Science=[65,65,68,97,68]
SST=[68,70,60,50,66]
data={'AdmNo':AdmNo,'StudName':StuName,'English':Eng,'Hindi':Hindi,
'Maths':Maths,'Science':Science,'SST':SST}
Record=pd.DataFrame(data)
print(Record)
AdmNo StudName English Hindi Maths Science SST
0 101 Kirti 87 80 90 65 68
1 102 Gunjan 76 79 76 65 70
2 103 Neetu 68 75 66 68 60
3 104 Pranjal 90 59 78 97 50
4 105 Kamal 88 60 86 68 66
50. She wants to add a new column ‘Total’ to calculate total marks. Help her choose the right command.
(i) Record['Total']=Record['English']+Record['Hindi']+Record ['Maths']+Record
['Science']+Record['SST']
(ii) Record['Total']=Record.iloc[:,2:6].add
Sample Question Paper 1
(iii) Record[Total]= Sum.Record[‘English’,’Hindi’,’Maths’,’Science’,’SST’]
(iv) Record.Total= Record['English']+Record['Hindi']+Record['Maths']+Record
['Science']+Record['SST']
51. She wants to reset the marks of Kirti to 0. Help her to select the right command.
(i) Record.loc[:0,'English':'Total']=0
(ii) Record.loc[:0,2:7]=0
(iii) Record.iloc[:0,2:7]=0
(iv) Both (i) and (iii)
52. What will be the output of the following command?
Record.index=AdmNo
print(Record.iloc[1:3,1:7])
(i) StudName English Hindi Maths Science SST
102 Gunjan 76 79 76 65 70
103 Neetu 68 75 66 68 60 A.9
(ii) StudName English Hindi Maths Science
101 Kirti 0 0 0 0
102 Gunjan 76 79 76 65

(iii)
StudName English Hindi Maths
101 Kirti 0 0 0
102 Gunjan 76 79 76
103 Neetu 68 75 66
(iv) None of the above
53. What will be the size and shape of dataframe Record?

AdmNo StudName English Hindi Maths Science SST Total


0 101 Kirti 0 0 0 0 0 0
1 102 Gunjan 76 79 76 65 70 366
2 103 Neetu 68 75 66 68 60 337
3 104 Pranjal 90 59 78 97 50 374
4 105 Kamal 88 60 86 68 66 368
(i) Size = 40 , Shape = (8, 5)
(ii) Size = 53, Shape = (5, 8)
(iii) Size = 45, Shape = (5,8)
(iv) Size = 40, Shape = (5,8)
54. Identify a command that will insert one more column ‘Class’ at 2nd place with data as ‘XII’ in the dataframe.
(i) Record.insert(loc=2, column = 'Class',value = ['XII'])
(ii) Record.insert(loc=3, column = 'Class')
(iii) Record.insert(loc=2, column = 'Class',value = ['XII','XII','XII','XII',
'XII'])
(iv) Both (i) and (iii)
55. She has more records in ‘Record2’ dataframe that she wants to add in the already created dataframe at
Informatics Practices with Python–XII

the end in a sequence. Identify the appropriate command.


(i) Record.append(Record2,ignore_index=True)
(ii) Record.add(Record2)
(iii) Record.join(Record2)
(iv) Record.insert(Record2)

A.10
ANSWERS (SAMPLE QUESTION PAPER 1)
1. (ii) Pandas 2. (i) NumPy 3. (ii) import pandas 4. (ii) Series 5. (iv) Float
6. (ii) Same 7. (iii) Line Chart 8. (iii) Matplotlib 9. (ii) drop() 10. (iii) Line Chart
11. (iii) Identifying your IP address and location by the web server while browsing.
12. (iv) Cybercrime 13. (i) Shareware software is the same as FOSS software.
14. (iv) All of the above
15. (ii) Manufacturing shoes in your factory and selling them with Adidas label.
16. (iii) Copying content from the internet and pasting it directly into your document.
17. (iv) ValueError 18. (iii) It should only be a product.
19. (iv) Df1.tail(5) 20. (iv) Destroy every component of the device.
21. (iii) The digital traces of all activities you leave on the internet.
22. (iv) Installing antivirus for protection 23. (iii) Created using Boolean indexing
24. (iii) Comma Separated Values 25. (ii) len()
26. (i) pd.Series(a,index=['One','Two','Three','Four'])
27. (iii) Salary + 2000 28. (i) pd.Series(Marks,index=subjects) 29. (ii) Firewall
30. (i) plt.plot(x,y,'x',markersize=5, markeredgecolor='r')
plt.show()
31. (i) Both statements are correct. 32. (iii) A line chart is created using line() function of pyplot module.
33. (iii) GIMP 34. (ii) Statement 2 and 4 35. (i) e 45
c 5
36. (iv) Playing online games on the internet. 37. (iii) Emp.rename(columns={'Name’:’EmpName’},inplace=True)
38. (iii) Leftover food 39. (iv) Missing data in Pandas object is represented as None.
40. (iii) True 12
False 9
False 10
True 10
dtype: int64
41. (iv) All of the above. 42. (i) Final.drop(['SSt'],axis=0)
43. (i) Aarti 401
Rahul 410
Pardeep 488
dtype: int64
44. (iii) data={'Name':EmpName,'Designation':Desig,'Salary':Salary} 45. (iii) It can be distributed only 10 times.
46. (iv) Both a and c
47. (i) 2 Chetan
3 Shagun
Name: Name, dtype: object
48. (i) Student1 True Sample Question Paper 1
Student2 True
Student3 False
Name: Marks, dtype: bool
49. (iii) Statement 1 is true but Statement 2 is false.
50. (i) Record['Total']=Record['English']+Record['Hindi']+Record['Maths']+Record['Science']+Record['SST']
51. (iv) Both (i) and (iii)
52. (i) StudName English Hindi Maths Science SST
102 Gunjan 76 79 76 65 70
103 Neetu 68 75 66 68 60

53. (iv) Size = 40, Shape = (5,8) 54. (iv) Both (i) and (iii)
55. (i) Record.append(Record2,ignore_index=True)

A.11

You might also like