IP - Class XII

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

THE SCHOOL OF THE GOOD SHEPHERD

SENIOR SECONDARY

PRE BOARD EXAMINATION FIRST TERM – 2021-2022


CLASS XII INFORMATICS PRACTICES MAX.MARKS:35
TIME: 1 ½ Hrs
<

General Instructions:
 The paper is divided into 3 Sections- A, B and C.
 Section A, consists of Question 1 to 25 and student need to attempt 20
questions.
 Section B, consists of Question number 26 to 49 and student need to
attempt 20 questions.
 Section C, consists of Question number 50 to 55 and student need to
attempt 5 questions.
 All questions carry equal marks (0.77 mark per question).

SECTION – A
Section - A consists of 25 questions, attempt any 20 questions

1. The axis 0 identifies a dataframe's


(a) rows (b) columns (c) values (d) datatype

2. Which of the following is not a valid line style in matplotlib?


(a) „-‟ (b) „--‟ (c) „-.‟ (d) „<‟
3. CSV stands for:
(a) Comma Separated Variables (b) Comma Separated Variables
(c) Column Separated Values (d) Comma Separated Values
4. To check if the Series object contains NaN values, ___________ attribute
is displayed.
(a) nbytes (b) hasnans (c) ndim (d) dtype
5. “Rice Bucket Challenge” is an example of
(a) Crowd Sourcing (b) Online Campaign
(c) Smart Mobs (d) Internet Addiction
6. Posting your friend‟s personal information on social media without
taking permission from her is the violation of
(a) Copyright (b) Net Etiquettes
(c) Plagiarism (d) None of these
7. The head() function display _________rows by default in a dataframe.
(a) 3 (b) 4 (c) 5 (d) 6
8. _____________ is the function to save the graph.
(a) Savefig() (b) Savefigure() (c) Savegraph() (d) Savechart()

Page 1 of 10
9. While creating dataframe if number of index values is not equal to
number of rows, which type of error it will raise?
(a) Key Error (b) Syntax Error (c) Name Error (d) Value Error

10. Which of the following are examples of visualization that we come


across in our daily life?
(a) Traffic symbols (b) Ultrasound reports
(c) Speedometer of a vehicle (d) All of the above
11. When we create a series from dictionary then the keys of dictionary
become ________________.

(a) Index of the series (b) Value of the series


(c) Caption of the series (d) None of the series
12. Which of the following parameters of the read_csv function is used to
make one of the columns of the data in the csv file as index of the data
frame.
(a) skiprows (b) index_row (c) nrows (d) index_col
13. Write the output of the following :
>>> S1=pandas.Series(“Hello”, index = ['One', 'Two', 'Three'])
>>> print(S1)
(a) One Hello (b) One Hello (c) Error (d) None of the above
Two Hello
Three Hello
14. Out of the following, which function cannot be used for customization of
charts in Python?
(a) xlabel() (b) colour() (c) title() (d) xticks()
15. Which of the following import statement is not correct?
(a) import pandas as class12 (b) import pandas as 1pd
(c) import pandas as pd (d) None of these
16. ______________ is a trail of data reflecting user‟s activities, actions,
communications or transactions in digital media.

(a) Digital Finger Print (b) Digital Footprint (c) Digital Hand print
(d) Digital data
Directions (Q No. 17 to 21) Read the extract given below and
answer the questions on the basis of the same.
Mr. Mathur wants to write Python code to create the following data
frame containing marks of 3 students. However, he is facing some
problems. Help him by answering a few questions below.

Page 2 of 10
Code to create the dataframe:
import pandas as pd
df=pd.DataFrame([[21.22.19],[23.22.16],[30.25.26],\
_______=[„S1‟,„S2‟,„S3‟])#statement 1
df._______=[„M1,„M2‟,„M3‟] #statement 2
print(df)
17. Choose the right code for statement 1.
(a) row (b) column (c) index (d) columns
18. He wants to rename the column M1 to MT1, which command should he
execute?
(a) df=df.rename(column={'M1':'MT1'}, inplace=True)
(b) df=df.rename({'M1':'MT1'})
(c) df=df.rename(columns={'M1':'MT1'},inplace=True)
(d) df=df.rename(column={'M1':'MT1'})
19. Choose the right code for statement 2.
(a) column (b) columns (c) value (d) values
20. Which of the following commands will output 2 for the above given Data
Frame?
(a) df.size (b) df.ndim (c) df.shape (d) df.index
21. He wants to obtain the sum of marks for each student as given below:
Choose the correct statement toobtain the same.
S1 62
S2 61
S3 81
dtype: int64
(a) print(df.sum(axis=0)) (b) print(df.sum())
(c) print(df.sum(0)) (d) print(df.sum(1))
22. What is the correct syntax to return both the first row and the second
row in a Pandas Data Frame df?
(a) df.loc[[0,1]] (b) df.[[0,1]] (c) df.loc[[0-1]] (d) df.[[0-1]]
23. Name the primary law in india dealing with cybercrime and electronic
commerce.
(a) Crime law (b) Cyber Law (c) IT Act (d) IT Law

24. Which of the following is not a type of cybercrime?


(a) Data theft (b) Forgery of online documents
(c) Damage to data and systems (d) Installing antivirus for protection
25. CSV file can be opened in
(a) Notepad (b) Wordpad (c) Excel (d) All of these

Page 3 of 10
SECTION – B
Section-B consists of 24 Questions (26 to 49). Attempt any 20 questions.
26. To display the 3rd, 4th and 5th columns from the 6th to 9th rows of a
dataframe DF; you can write ___________.
(a) DF.iloc[5 : 9, 3 : 5] (b) DF.iloc[6 : 9, 3 : 6]
(c) DF.iloc[6 : 10, 3 : 6] (d) DF.iloc[6 : 9, 3 : 5]
27. Which of the following command will display the column labels of the
DataFrame?
(a) print(emp.columns()) (b) print(emp.column())
(c) print(emp.column) (d) print(emp.columns)
28. A Data Frame is having True and False as its boolean indexes. The
command that can be used to access all the rows corresponding to True
boolean index is
(a) print(df.loc(True) (b) print(df.loc[:,True])
(c) print(df.loc[True]) (d) print(df.loc(True,:)
29. Write the output of the following :-
import pandas as pd
S=pd.Series([1,2,3,4,5], index=[„a‟, „b‟, „c‟, „d‟, „e‟])
print(S[::-4])
(a) e 5 (b) a 1 (c) a 1 (d) e 5
a 1 e 5 d 4 d 2
30. A Social science teacher wants to use a pandas series to teach about Indian
historical monuments and its states. The series should have the monument
names as values and state names as indexes which are stored in the given
lists. Choose the statement which will create the series : -
import pandas as pd
monuments=[„QUTAB MINAR‟, „GATEWAY OF INDIA‟, „RED FORT‟, „TAJ MAHAL‟]
state=[„DELHI‟,‟MAHARASTRA‟,‟DELHI‟,‟UTTAR PRADESH‟]
a. S=df.Series(Monuments,index=state)
b. S=pd.Series(state,monuments)
c. S=pd.Series(Monuments,index=State)
d. None of these
31. Which of the following code will generate the following output?
Jan 31
Feb 28
Mar 31
dtype: int64
(a) import pandas as pd
S1 = pd.Series(data = [31, 28, 31], index=["Jan","Feb","Mar"])
print(S1)
(b) import pandas as pd
S1 = pd.Series([31, 28, 31], index=["Jan", "Feb", "Mar"])
print(S1)
(c) Both of the above
(d) None of the above
Page 4 of 10
32.

Observe the above figure. Identify the coding for obtaining this as
output.
Identify the coding for obtaining this as output.
(a) import matplotlib.pyplot as plt
eng_marks=[10,55,30,80,50]
st_name=[“amit”, “dinesh”, “abhishek”, “piyush”, “rita”]
plt.plot(st_name, eng_marks)
plt.show()
(b) import matplotlib.pyplot as plt
eng_marks=[10,55,30,80,50]
st_name=[“amit”, “dinesh”, “abhishek”, “piyush”, “rita”]
plt.plot(eng_marks, st_name)
plt.show()
(c) import matplotlib.pyplot as plt
eng_marks=[10,55,30,80,50]
st_name=[“amit”, “dinesh”, “abhishek”, “piyush”, “rita”]
plt.plot(engmarks, st_name)
plt.show()
(d) import matplotlib.pyplot as plt
eng_marks=[10,55,30,80,50]
st_name=[“amit”, “dinesh”, “abhishek”, “piyush”, “rita”]
plt.plot(eng_marks, stname)
plt.show()

33. Write the output of the following code:


import pandas as pd
S1=pd.Series([1, 2, 3, 4])
S2=pd.Series([7, 8])
S3=S1+S2
print(S3.size)
(a) 2 (b) 4 (c) 6 (d) Error
34. Which of the following are feasible methods of e-waste management?
(a) Reduce (b) Reuse (c) Recycle (d) All of the above
35. Suhhani is confused about the free operating system available in the
market. Few of her friends suggested a few operating systems. Help her
in choosing free operating system for her device:
(a) Ubuntu (b) Windows (c) Mozilla Firefox (d) Blender

Page 5 of 10
36. What will be the output of the following?
>>> seriesMnths = pd.Series([2,3,4,index=[“Feb”,“Mar”,“Apr”])
>>> seriesMnths[1]
(a) 2 (b) Mar (c) Feb (d) 3
37. Choose the correct output of the following code:
>>> seriesCapsCntry = pd.Series([„NewDelhi‟,„WashingtonDC‟,„London‟,
„Paris‟],index=[“India”, “USA”, “UK”, “France”])
>>> seriesCapCntry[[3,2]]
(a) France Paris
France Paris
(b) USA WashingtonDC
France Paris
(c) France Paris
UK London
(d) USA WashingtonDC
UK London
38. Choose the correct code that produces the output below:
9 18
10 20
11 22
12 24
(a) a=np.arange(9, 13)
s1=pd.Series(index=a, data=a*2)
print(s1)
(b) a=[9, 10, 11, 12]
s1=pd.Series(index=a, data=a*2)
print(s1)
(c) Both the above
(d) None of the above
39. Difference between drop() and del
(a) Both operates on columns and rows
(b) del operates on column only
(c) drop operates on column only
(d) del operates on rows only
40. Sumesh‟s continuous online classes and increasing use of computers
made his mother worried about his health.
Which of the following point should not be suggested by his mother to
take care of.
(a) Sit in right position
(b) Take breaks and do some physical activity
(c) Keep the gadgets above your height
(d) All the above
41. Mr. Vasu has designed a Open source software which must comply with
some criteria. Choose right statement in respect of above.
Statement I: No restriction on re-distribution of the software as a part or
whole

Page 6 of 10
Statement II: The integrity of the Author‟s source code must be
maintained
Statement III: The software can be sold after distribution
(a) Statement I is False (b) Statements I and II are True
(c) Statements II and III are True (d) Statements I, II and III are True
42. Write short code to show the information having city=”Delhi” from data
frame SHOP
(a) print(SHOP[City= “Delhi”])
(b) print(SHOP[SHOP.City== “Delhi”])
(c) print(SHOP[SHOP. “City”== “Delhi”])
(d) print(SHOP[SHOP [City]== “Delhi”])

43. Consider the following data frame name df.

Name Age Marks


0 Amit 15 90.0
1 Bhavdeep 16 Nan
2 Reema 17 87.0
Write the output of the given command :- print(df.marks/2)
(a)0 45.0 (b) 0 45.0 (c) 0 45 (d) 0 45.0
1 Nan 1 Nan 1 Nan 1 0
2 43.5 2 43 2 43.5 2 43.5

44. Which argument must be set with plotting functions for legend( ) to
display the legends ?
(a) data (b) label (c) name (d) sequence

45. Which of the following is true?


Statement I: Firewall protects from unauthorized incoming traffic
Statement II: Firewall can be implemented as both Software and
Hardware
Statement III: Firewall grants access to work with a device
(a) Statement I and II are only True
(b) Statement II is only True
(c) Statement I is only True
(d) Statements I, II and III are True
46 Assuming the given structure, which command will give us the given
output:

Flight No. Airline Passenger


0 1 Indigo 230000
1 2 SpiceJet 12000
2 3 Indian Airlines 240000
3 4 Lufthnsa 245000
4 5 Air Asia 210000

Page 7 of 10
Output Required: (3.5)
(a) print(df.shape())
(b) print(df.shape)
(c) print(df.size)
(d) print(df.size())
47. The correct statement to read from a CSV file in a dataframe is :
(a) <DF>.read_csv(<file>)
(b) <File>. read_csv( )(<DF>)
(c) <DF> = pandas.read(<file>)
(d) <DF> = pandas.read_csv(<files>)
48. The command used to skip a row in a CSV file is
(a) next() (b) skip() (c) omit() (d) bounce()
49. The following cannot be exploited by assigning or by licensing the rights
to others.
(a) patent (b) design (c) trademark (d) all of the above
SECTION - C
Section - C, consists of 6 Question (50 to 55). Attempt any 5 questions.
Case Study
Radha is an analyst and working on some data. On which she wants to
do some operations, but she is facing some problem, help her:
Code:
import pandas as pd
AB={
'Naveen': pd.Series([90, 91, 97],
index=['Maths','Science','Hindi']),
'Rehana': pd.Series([92, 81, 96],
index=['Maths','Science','Hindi']),
'John': pd.Series([89, 91, 88],
index=['Maths','Science','Hindi']),
'Roja': pd.Series([81, 71, 67],
index=['Maths','Science','Hindi']),
'Mannat': pd.Series([94, 95, 99],
index=['Maths','Science','Hindi'])}
RS = pd.DataFrame(AB)
print(RS)
Output of the above code:

Based on the given information, answer the questions NO. 50-55.


50. She wants to add a new column with name of student „Nirmal‟ in above

Page 8 of 10
data frame
choose the right command to do so:
(a) RS['Nirmal']=[89,78,76]
(b) rs[' Nirmal ']=[89,78,76]
(c) RS[' Nirmal ']=[89,78,76,67]
(d) RS['Name'] =[89,78,76]
51. She wants to set all the values to zero in data frame, choose the right
command to do so:
(a) RS=0 (b) RS[]=0 (c) RS[:]=0 (d) RS[:]==0
52. She wants to delete the row of science marks:
(a) RS.drop('Science', axis=1) (b) RS.drop('Science', axis=0)
(c) RS.drop('Science', axis=-1) (d) RS.drop('Science', axis==0)
53. The following code is to create another data frame, which She wants to
add to the existing Data frame. Choose the right command to do so:
Sheet1={ 'Aaradhya': pd.Series([90, 91, 97],
index=['Maths','Science','Hindi'])}
S1=pd.DataFrame(Sheet1)
(a) RS.append(S1,axis=0) (b) RS.append(S1) (c) RS.insert(S1)
(d) RS.join(S1)
54. What will be the output of the given command?

Naveen Rehana John Roja Mannat


A Maths 90 92 89 81 94
(a)
B Science 91 81 91 71 95
C Hindi 97 96 88 67 99

Naveen Rehana John Roja Mannat


A 90 92 89 81 94
(b)
B 91 81 91 71 95
C 97 96 88 67 99
A B C Roja Mannat
Maths 90 92 89 81 94
(c)
Science 91 81 91 71 95
Hindi 97 96 88 67 99

(d) Error, Index already exists and cannot be overwritten.


55. What will be the output of the given command?

Page 9 of 10
print (RS.size)
a. 15
b. 18
c. 21
d. 23

****************************

Page 10 of 10

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy