Screenshot 2021-12-20 at 6.27.38 PM

You might also like

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

CBSE Sample Paper Informatics Practices Class XII (Term I) 57

SAMPLE PAPER 3
INFORMATICS PRACTICES
A Highly Simulated Practice Questions Paper
for CBSE Class XII (Term I) Examination

Instructions
1. This question paper is divided into three sections.
2. Section - A contains 25 questions (1-25). Attempt any 20 questions.
3. Section - B contains 24 questions (26-49). Attempt any 20 questions.
4. Section - C contains 6 case study based questions (50-55). Attempt any 5 questions.
5. Each question carries 0.77 mark.
6. There is no negative marking.

Maximum Marks : 35
Roll No. Time allowed : 90 min

Section A
This section consists of 25 questions (1 to 25). Attempt any 20 questions from this section. Choose the best
possible option.

1. The default delimiter of a CSV file is


(a) , (b) : (c) . (d) ;
2. To iterate through the rows of a DataFrame, row-wise the function used is
(a) iterrows() (b) iteritems() (c) iterrecords() (d) itertuples()

3. A line chart can plot


(a) a single line (b) 2 lines (c) 3 lines (d) multiple lines
4. How many values will be there in the series created by the following statement?
import pandas as pd
s=pd.Series(100,index=range( 10, 1, 4))
(a) 1 (b) 2
(c) 4 (d) Empty set
5. import numpy as np
import pandas as pd
s=pd.Series([1,np.NaN,2,3,np.NaN])
print(s.count())
The output of the above code is
(a) 3 (b) 5 (c) 0 (d) None of these
6. The term not related to pandas is
(a) index (b) series (c) head() (d) stack

7. The indexes of a series can be


(a) integers (b) characters
(c) strings (d) All of these

8. Indexes of a series can be


(a) duplicate
(b) must be unique
(c) can be duplicate, if indexes are numbers
(d) can be duplicate, if indexes are strings

9. The column labels of a dataframe can be


(a) only assigned while creation
(b) can be assigned at any point of time
(c) columns can only have system defined indexes
(d) None of the above

10. Which of the following operation is not a part of pandas module?


(a) Data query
(b) Data storage in one and two-dimensional structures
(c) Data analysis
(d) Data visualisation
11. Rony received bulk amounts of unnecessary E-mails in his mailbox, what kind of
threat is this?
(a) Hacking (b) Phishing (c) Data theft (d) Spamming

12. Nisha wanted a software for her official documentation work, but she does not want to
pay for it. Which type of software she should procure?
(a) Closed software (b) Free software
(c) Commercial software (d) Proprietary software

13. John was using an antivirus software for free for a month , one morning he found the
software stopped working saying that it needs to be bought. What category of software does
it belong to?
(a) Proprietary software (b) Free software
(c) Freeware software (d) Shareware software
14. The minimum number of parameters required by the Series() function to create a
non-empty series is
(a) 1 (b) 0 (c) 3 (d) 4

15. Which of the following are not the health hazards of technology?
(a) Musculoskeletal problems (b) Vision problems
(c) Heart problems (d) Sleeplessness

16. Robert is confused between the terms FOSS and OSS, the statement that clarifies it is.
(a) FOSS is OSS that is free.
(b) FOSS is not open source , but OSS is open source.
(c) FOSS is to be bought , but OSS is not paid.
(d) FOSS is limited period use , but OSS is free for unlimited period.
17. The tail() function without any parameters extracts ……… number of rows from end of
a series.
(a) 1 (b) 2 (c) 5 (d) 0

18. Which of the following acts are not done by cyber criminals?
(a) Report vulnerability in any system (b) Mass attack using trojans
(c) Email spoofing and spamming (d) Unauthorised account access

19. The statement used to change the name of the index of a Series “s” is
(a) s.name=newname (b) s.index.name=”newname”
(c) s.indexname=”newname” (d) s.index_name=”newname”

20. Albert found that while logging to his E-mail account , the password was coming
automatically , what is responsible for this?
(a) Trojans (b) Viruses
(c) Cookies (d) Password manager
21. The least dangerous type of malware is
(a) worm (b) spyware (c) spamming (d) virus
22. Which one of the following is not a netiquette?
(a) Cyber bullying (b) Don’t troll people in web forums
(c) Respecting others privacy (d) Do not trust others when you are new

23. What is ITA-2000?


(a) Information Technology Affairs - 2000
(b) Information Technology Amendments - 2000
(c) Indian Trading Acts - 2000
(d) Information Technology Act- 2000

24. The property that is used to check whether a series is empty or not.
(a) nbytes (b) empty
(c) none (d) null
25. Which property of a dataframe performs a transpose of a dataframe?
(a) shape (b) T
(c) len (d) ndim

Section B
This section consists of 24 questions (26 to 49). Attempt any 20 questions.

26. Given a Series:


flavours=pd.Series ([‘Vanilla’,‘Chocolate’,‘Butter’, ‘Coconut’],
index=[‘p’,‘q’,‘r’,‘s’])
print(flavours.loc[‘q’:‘r’])
Find the output of the above code.
(a) q Chocolate
r Butter
(b) q Chocolate
(c) r Butter
(d) Empty set
27. Given a Series “myseries” created as:
import pandas as pd
import ________ as np
myseries=pd.Series([30,40, _____ ,440,670])
print(myseries)
Output
0 30.0
1 40.0
2 NaN
3 440.0
4 670.0
What should be filled in the blanks to get the output?
(a) Numpy, NaN (b) random,np.NaN (c) numpy, np.NaN (d) None of these
28. Sunaina wanted to rearrange the contents of a DataFrame “scoredf” on the basis of
indexes, the statement she has to write is
( The present order of indexes are (0,1,2,3,4) and the new order is to be (4,2,3,0,1))
(a) scoredf=scoredf.reindex([1,4,3,2,0])
(b) scoredf=scoredf.reindex([4,2,3,0,1])
(c) scoredf=scoredf.re_index([4,2,3,0,1])
(d) scoredf=scoredf.arrange_index([4,2,3,0,1])

29. Stealing the creations done from ideas or minds , of others is


(a) piracy (b) hacking (c) plagiarism (d) stalking
30. Given the following plot , the code to plot the box at the top left corner showing lines
for Science and Commerce is
Science versus Commerce
14 Science
Commerce
12
10
Marks

Ria Akash Ravi Naina Priya Ashok


Names
(a) import matplotlib.pyplot as p
p.box(“Science”,“Commerce”)
(b) import matplotlib.pyplot as p
p.show()
(c) import matplotlib.pyplot as p
p.legend()
(d) p.label()
31. Statement A The function to provide a x-axis label is xlabel().
Statement B It is compulsory to provide a xlabel.
(a) Statement A is correct.
(b) Statement B is correct.
(c) Statement A is correct, Statement B is incorrect.
(d) Statement A is incorrect, Statement B is correct.
32. A bar chart can be saved by the
(a) savebar() function (b) savepic() function
(c) savechart() function (d) savefig() function

33. Encryption of passwords provides


(a) insecurity (b) security
(c) compression (d) backup

34. Given the statements with respect to intrusion of computer viruses.


Statement A A computer virus can intrude from books.
Statement B A computer virus can intrude from radiation.
Statement C A computer virus can intrude from a pen drive.
Statement D A computer virus can intrude from the network.
(a) Statement A and Statement B (b) Statement B and Statement C
(c) Statement C and Statement D (d) Statement B and Statement D

35. Given the following code to create a Series as


import pandas as mp
redSeries=mp.Series(100,index=range(100, 60, 15))
print(redSeries)
Find the output of above code.
(a) 100 100 (b) 100 100 (c) 100 100 (d) 100 100
85 100 70 100 85 100 85 100
70 100 70 100 70 100
55 100 55 100
40 100

36. Which of the following is/are true about a proprietary software?


(a) Available for free (b) Can be freely copied
(c) Needs a license to be bought (d) All of these

37. The correct way to create an empty DataFrame is


(a) import pandas as p (b) import pandas as p
df=p.Dataframe() df=p.DataFrame()
(c) df=p.Dataframe(Empty) (d) None of these

38. The term digital footprints can also be referred as


(a) digital traces (b) digital symbols
(c) digital tattoos (d) None of these

39. The index of a DataFrame starts by default from.


(a) 1 (b) 0 S
A
M
P
(c) 2 (d) ‘a’ L
E
40. Given the code :
d={‘Name’:[‘Ram’,‘Shyam’,‘Sita’,‘Laxman’],‘Age’:[26,24,22,23],
‘Score’:[85,63,55,74]}
Scoredf=pd.DataFrame(d,columns=[‘Name’,‘Age’,‘Score’])
Scoredf = Scoredf.rename(index={0:‘First Player’,1:‘Second Player’,2:‘Third P
Player’,3:‘Fourth Player’})
APER
print(Scoredf)

3
What will be the output of the code?
(a) Name Age Score
First Player Ram 26 85
Second Player Shyam 24 63
Third Player Sita 22 55
Fourth Player Laxman 23 74
(b) Name Age Score
First Player Ram 26 85
Second Player Shyam 24 63
(c) Age Score
First Player 26 85
Second Player 24 63
Third Player 22 55
Fourth Player 23 74
(d) The code will produce an error

41. Debarati was feeling health related problems for few days as she uses the digital
gadgets excessively, which preventive measures would relax her
(a) talking to her friends
(b) having a balanced diet
(c) perform physical exercises regularly and apply water to her eyes periodically
(d) None of the above
42. The keyword that includes a module in Python is
(a) imports (b) include (c) add (d) import
43. Given the Series waterseries prepared as:
waterdict={‘Plain’:20,‘Sweet’:50,‘Distilled’:100}
waterseries=p.Series(waterdict)
print(waterseries)
Output
Plain 20
Sweet 50
Distilled 100
The statement to give the following output is
Distilled 100
Plain 20
(a) waterseries[: : 1] (b) waterseries[: : 2]
(c) waterseries[: : 0] (d) waterseries[: :]
44. Rama created a Series storing the names and prices of icecreams as follows :
import pandas as pd
icecream=pd.Series([150,200,300],index=[‘Blackberry’,‘Blachforest’,‘Butter’])
She wants to display the icecream prices increased by 30 , a statement to do so is
(a) import pandas as pd (b) import pandas as pd
icecream+30 icecream=[30]
(c) import pandas as pd (d) None of these
icecream[price]=price+30
45. Which of the following is not affected by computer viruses?
(a) Hard disk (b) Network system (c) SMPS (d) Pen drives
46. Given a dataframe ‘Roomdf’
Index Rno Rtype Tariff
0 123 AC 3000
1 124 General 1000
2 125 Deluxe 4500
The command that displays the third row is
(a) Roomdf.iloc[2:] (b) Roomdf.loc[2:] (c) Roomdf[2:] (d) All of these
47. A Series ‘s’ is created as :
0 11
1 22
2 33
3 44
4 55
What will be the output of print(s[ 3: : 1 ])?
(a) 2 33 (b) 1 22 (c) 2 33 (d) Error in code
1 22 0 11 0 11
0 11
48. Given a dataframe “Proddf” carrying the following data of products:
Index Prodid Pname Qty
0 1 Tea 25
1 2 Coffee 40
2 3 Snacks 50
The statement to display only the ‘Qty’ of all products is
(a) Proddf[,:,“Qty”] (b) Proddf[“Qty”]
(c) Proddf[“Qty”,:] (d) Proddf[:,“Qty”]
49. Given statements about a series.
Statement A The values property prints the list of values from a Series.
Statement B It also prints the data type of the values.
(a) Both statements are correct.
(b) Both statements are incorrect.
(c) Statement A is correct , but Statement B is incorrect.
(d) Statement A is incorrect , but Statement B is correct.

Section C
(Case Study Based Questions)
This section consists of 6 questions (50 to 55). Attempt any 5 questions.
Mr. Krishnamurthy, who is a new user of Python Pandas , has created the following
series “Electrical” carrying names of electrical appliances as values and their wattage
as the index. He wants to perform certain operations on the series . You are supposed
to help him in writing the commands.
Electrical
Index Name
12W LED
200W Fan
1000W Electric Iron
1200W Rice Cooker
50. He created another series “Electrical1” storing?
Index Name
12W Bulb
200W Induction
What will be the output of Electrical + Electrical1?
(a) Index Name (b) Index Name
12W LEDBulb 12W LEDBulb
200W FanInduction 200W FanInduction
1000W NaN 1000W Electric Iron
1200W NaN 1200W Rice Cooker
(c) Index Name (d) None of these
12W LEDBulb
200W FanInduction
1000W Electric Iron
51. He wants to display only the first two rows of “Electrical” , the statement that he
should write is
(a) Electrical[0:3] (b) Electrical[0:2]
(c) Electrical.loc[“12W”:”200W”] (d) Both (b) and (c)
52. The dimension of the series “Electrical” is given by
(a) Electrical.dimension (b) Electrical.dim (c) Electrical.ndim (d) Electrical.bytes
53. What will be the output of the statement?
Electrical[Electrical==“Fan”]
(a) 1 Fan (b) 200W Fan (c) Empty set (d) Error
54. He wants to change the index of Electrical series “LED” element to “A” ,the command
will be:
(a) Electrical=Electrical.rename(index={‘12W’:“A”})
(b) Electrical=Electrical.ren(index={‘12W’:“A”})
(c) Electrical=Electrical.rename({‘12W’:“A”})
(d) Both (a) and (c)
55. He wrote the statement:
del Electrical [“1000 W”]
print (Electrical)
What will be the output of the above statement?
(a) Index Name
12W LED
200W Fan
1000W Electric Iron
1200W Rice Cooker
(b) Index Name
12W LED
200W Fan
1200W Rice Cooker
(c) Index Name
12W LED
200W Fan
(d) None of the above
OMR SHEET SP 3
Roll No.

Student Name Sub Code.

Instructions
Use black or blue ball point pens and avoid Gel & Fountain pens for filling the OMR sheet.
Darken the bubbles completely. Don’t put a tick mark or a cross mark, half-filled or over-filled bubbles will not be read
by the software.

Correct Incorrect Incorrect Incorrect


Do not write anything on the OMR Sheet.
Multiple markings are invalid.

1 20 38
2 21 39
3 22 40
4 23 41
5 24 42
6 25 43
7 26 44
8 27 45
9 28 46
10 29 47
11 30 48
12 31 49
13 32 50
14 33 51
15 34 52
16 35 53
17 36 54
18 37 55
19

Check Your Performance


Total Questions: Total Correct Questions
Score Percentage = × 100
Total Correct Questions: Total Questions

Less than 60% > Average (Revise the concepts again)


If Your Score is Greater than 60% but less than 75% > Good (Do more practice)
Above 75% > Excellent (Keep it on)
66 CBSE Sample Paper Informatics Practices Class XII (Term I)

Answers
1. (a) 2. (a) 3. (d) 4. (d) 5. (a) 6. (d) 7. (d) 8. (a) 9. (b) 10. (d)
11. (d) 12. (b) 13. (d) 14. (a) 15. (c) 16. (a) 17. (c) 18. (a) 19. (b) 20. (c)
21. (c) 22. (a) 23. (d) 24. (b) 25. (b) 26. (a) 27. (c) 28. (b) 29. (c) 30. (c)
31. (c) 32. (d) 33. (b) 34. (c) 35. (c) 36. (c) 37. (b) 38. (c) 39. (b) 40. (a)
41. (c) 42. (d) 43. (b) 44. (a) 45. (c) 46. (d) 47. (a) 48. (b) 49. (a) 50. (a)
51. (d) 52. (c) 53. (b) 54. (a) 55. (b)

SOLUTIONS
1. The default delimiter of a CSV file is “,” 13. Sharewares are softwares that are available for
that’s why it is called comma separated free usage for a limited period after which they
values file. need to be bought. e.g. Anti-virus softwares, etc.
2. The iterrows() function loops through the 14. To create a non-empty series a minimum
rows of a dataframe and the iteritems() number of argument required for carrying data
function iterates column-wise. values is 1.
3. A line chart can have multiple lines plotted. 15. Excessive use of technology can cause
4. The range( 10, 1, 4) returns no values , so the musculoskeletal problems, vision problems and
series will contain no values. lack of sleep. Heart problems are not very
common due to use of technology.
5. NaN values are not counted as values of a
series. So the count is 3. 16. FOSS (Free and Open Source Softwares) are
those that are both free and open source.
6. Stack is a data structure that follows the LIFO
technique. This data structure is not natively OSS (Open Source Software) are those that are
available in pandas. open source but may or may not be free.
7. The indexes of a series can be integers, 17. When the tail ( ) function is used to extract data
characters and strings. Series can be created from a series, if no parameter is specified , by
as: default 5 trailing elements are extracted.
import pandas as p 18. Cyber criminals access accounts without
s1=p.Series(20,index=[0,1,2,3]) authorisation , do flooding of E-mail accounts
s2=p.Series(20,index=[‘a’,‘b’,‘c’,‘d’]) and also attack systems by trojans. Report
s3=p.Series(20,index=[“abc”,“pqr”,“xyz”, vulnerability in any system is not done by cyber
“mno”]) criminals.
8. Series indexes can be duplicate with any 19. The index.name property can be used to change
types of data. the name of the index.
9. Pandas allows changing the column labels at 20. A cookie is a temporary internet file that stores
any point of time. user information that can be used on
sub-sequent logins , so that the user need not
10. Data visualisation includes plotting of charts retype the same data.
which is not available with in pandas module.
21. Worms and viruses can excessively destroy
11. The sending of unnecessary junk mails from systems by deleting files , crashing the system
unauthenticated sources that fill up the and the operating system , even spywares can
mailbox , is called spamming. steal important data from the system .
12. Free softwares are available for free usage . Spamming is least dangerous type of malware,
Since she wants a software which is available that fills the mail box with unnecessary mails
free of cost , she should procure a free but does not do drastic harms.
software.
22. Netiquette means respecting other user’s 33. Encryption secures the passwords from potential
views and displaying common etiquette hackers and crackers by changing the text ,
when posting your views to online adding characters and other algorithms.
discussion groups. 34. A virus can appear from any external source
23. The Information Technology Act- 2000 was connected to the system, such as a pen drive ,
laid in October 2000 and is commonly called another computer or the network.
ITA-2000 . It contains sections to protect 35. The range(100,60, 15) returns the values 100 , 85,
citizens against crimes committed over the 70 starting from 100 decrementing by 15. Since
network. the data given is a constant 100 , the entire series
24. The empty attribute of a series can be used to carries the same data and the indexes 100,85,70.
check whether a series contains any elements 36. Proprietary softwares like Windows , Oracle,
or not. etc., need a license to be bought for its usage.
25. The following code shows the working of 37. The DataFrame() function when used without
“T ’’ attribute of a dataframe to transpose it. any parameters creates an empty dataframe.
>>>print(studentdf)
38. Digital footprints are also called by the name
Roll Name digital tattoos.
0 1 a
39. In both the data structures series and dataframe,
1 2 b the index starts from 0 to (n 1), where n is the
>>> print(studentdf.T) number of elements.
0 1 40. The rename method of a DataFrame can be used
Roll 1 2 to change the names of the indexes.
Name a b Here, the default indexes have been renamed to
26. The loc() function extracts elements from a ‘First Player’,’Second Player’ ….
series based on user indexes and from start 41. Physical exercises can prevent musculoskeletal
to the endindex , so flavours.loc[‘q’:‘r’] problems and applying water to eyes
extracts both the elements at indexes ‘q’ and periodically can save her eyes.
‘r’.
42. The statement to include a module is
27. To use the NaN constant, the numpy module
import <modulename> as <alias>
needs to be imported .Since numpy has been
imported as “np” , so NaN has to be used as e.g. import numpy as n
np.NaN. 43. The statement waterseries[: : 2] extracts
28. The function to reindex the dataframe is elements from the end to beginning going
<dataframe>.reindex, where the new backwards skipping by 2.
arrangement of the indexes is to be specified. 44. Adding a value to a series, add the value to all
29. The act of stealing creations made from the the values of the series.
innovative minds of others like books, 45. The SMPS (Switch Mode Power Supply) is an
software etc., and publishing them in one’s electrical unit that cannot be affected by virus
own name is called plagiarism. softwares.
30. The box is called a legend box.The legend() 46. All the statements display the records starting
function displays a legend box to indicate the from index 2 , which is the third row.
identity of the plots by their colors.
47. The statement print(s[ 3: : 1 ]) prints the
31. The xlabel() function displays the x-axis elements from index 3 to the beginning
label. Providing a x-axis label is not decrementing by 1. In series, the last element
compulsory, if added it increases the has index 1,second last has index 2 and so on.
readability of the chart.
48. The statement to display only the Qty of all
32. The savefig() function can be used to save products is Proddf ["Qty "].
any type of chart to an image file.
49. The values property prints the list of values as 51. Electrical[0:2] displays rows 0 and 1 ,
well as the data type of the values from a Series. Electrical.loc[“12W”:”200W”] displays the
The code below shows the working of values rows at indices “12W” and “200W”.
property : 52. The ndim attribute displays the number of
Suppose Series S1 is dimensions of a series.
0 1 53. The command Electrical[Electrical==”Fan”]
1 2 matches the rows where the value is “Fan”
and displays them.
2 3
print(s1.values) 54. The rename function can be used to rename
an index with the index attribute and
Output array([1, 2, 3], dtype=int64)
specifying the old and new index.
50. The addition operation on two series adds /
55. The del function along with the index
merges values for same indexes, for
removes the element at the index
non-matching indexes it gives a NaN.
permanently.

You might also like