Unseen Passage

For Class 4 to Class 12

Class 12 Informatics Practices Sample Paper Term 1 Set A

Section A

Question 1. A dataframe is created by a dictionary carrying 3 keys and 4 values against each of the keys. How many columns will be there in the dataframe?
(a) 2
(b) 1
(c) 3
(d) 4

Answer

C

Question 2. Which of the following is not a type of histogram?
(a) step
(b) barstacked
(c) bar
(d) pie

Answer

D

Question 3. The function that is used to manipulate the x-axis ticks in a chart is
(a) xaxisticks
(b) xticks
(c) axis
(d) axisticks

Answer

B

Question 4. Given a dataframe mydf carring data of some food items , what will the following statement produce?
print(mydf.head(2,3))
(a) The 3rd element of row 2
(b) The entire 2nd row
(c) Error
(d) The 2nd element of row 3

Answer

C

Question 5. In creation of a series, which of the following statement is correct?
(a) Data values must be provided before index.
(b) Index values must be provided before data.
(c) Data and index can be specified in any order.
(d) Index cannot be specified in series creation.

Answer

C

Question 6. Providing alias names for modules imported is
(a) compulsory
(b) not compulsory
(c) makes writing code convinient
(d) Both (b) and (c)

Answer

D

Question 7. An empty dataframe stores
(a) NaN values
(b) No values
(c) 0s
(d) 1s

Answer

B

Question 8. If a series is created with 5 values the default index of the last element is
(a) 5
(b) 4
(c) 6
(d) –2

Answer

B

Question 9. Given a series “S1” made by the statement S1=pd.Series((1,2,3)), which of the following operations are invalid?
(a) S1+2
(b) S1*2
(c) S1//2
(d) All are valid

Answer

D

Question 10. In creation of a series providing, the index is
(a) compulsory
(b) optional
(c) compulsory , if created from a list
(d) compulsory , if created from a tuple

Answer

B

Question 11. Which amongst the following are not uses of internet technology?
(a) Online shopping
(b) Video conferencing
(c) Online payment
(d) Installation of software from a DVD

Answer

D

Question 12. LAMP stands for
(a) Linux,Apple,MySQL,Photoshop
(b) Linux, Apache, Max, Python
(c) Linux, Apache , MySQL,PHP
(d) None of these

Answer

C

Question 13. Jennifer was trying to see the key locations of fingers on the keyboard , of her colleague,while she was trying to open her E-mail account, what kind of network threat is this?
(a) Password guessing
(b) Snooping
(c) Spamming
(d) Both (a) and (b)

Answer

D

Question 14. Mr. Kaushik wanted to replace the elements at indexes 1 and 2 of his series “Bookseries” to 200, what command he should write?
(a) Bookseries [1:2]=200
(b) Bookseries [1:3]=200
(c) Bookseries [1:]=200
(d) Bookseries [0:2]=200

Answer

B

Question 15. Shraddha , a programmer does not like some of the features of the software MS-Office and she wants to see the source code of the software and change it , she
(a) can open the source code and modify
(b) can approach Microsoft to make the source code available
(c) cannot change the source code because it is a proprietary software
(d) can get a higher paid version that provides the source code

Answer

C

Question 16. Which of the following is not an e-Waste?
(a) Motherboard
(b) Broken Monitor
(c) Broken printer
(d) Iron rods

Answer

D

Question 17. Two Series are created as follows:
s=pd.Series([10,15,20])
s1=pd.Series([12,14,22])
The statement s<s1 will display ________ ‘True’ as output.
(a) 1
(b) 2
(c) 3
(d) 0

Answer

B

Question 18. Neha was getting threatening E-mails from last few days from an unknown E-mail id , the proper action for her is
(a) mark the mail as spam
(b) report to the cyber crime cell
(c) Both (a) and (b)
(d) send a reply to the source asking the identity

Answer

C

Question 19. Which of the following is the key data structure of pandas?
(a) Panel
(b) Series
(c) DataFrame
(d) Queue

Answer

C

Question 20. Traditional symbols and signs can be protected as
(a) patent
(b) trademark
(c) digital footprints
(d) None of these

Answer

B

Question 21. What kind of illegal activity can happen if a wrong link is clicked?
(a) Hacking
(b) Illegal download
(c) Identity theft
(d) Both (b) and (c)

Answer

D

Question 22. The right of an author of a book to get financial benefit from the book written by him/her is called
(a) IPR
(b) property right
(c) book right
(d) None of these

Answer

A

Question 23. In Python pandas, the statement that is incorrect about index is
(a) can be duplicate
(b) must be unique
(c) must be of the same count as the values
(d) All are correct

Answer

A

Question 24. The pandas library is
(a) free
(b) open source
(c) needs to be exclusively bought
(d) Both (a) and (b)

Answer

D

Question 25. The attribute of read_csv() function that specifies the columns to be read is
(a) cols
(b) columns
(c) usecols
(d) readcols

Answer

C

Section B

Question 26. A series “Rankers” stores the ranks as indexes and names as values of students qualified in JEE as follows :
Index    Values
12          Rakesh
256       Priya
4           Anindita
To get the names of students whose rank is less than 10 the code would be
(a) for r in Rankers.index:
if r<10: if r<10:
print(Rankers[r])
(b) for r in Rankers.values:
 print(Rankers[r])
(c) for r in Rankers
if r<10:
print(Rankers[r])
(d) None of these

Answer

A

Question 27. Given a dataframe storing marks of some college students as follows :
import pandas as pd
dict = {‘Name’:[‘Martha’, ‘Tim’, ‘Rob’, ‘Georgia’],‘Maths’:[87, 91, 97, 95],
‘Science’:[83, 99, 84, 76]}
df = pd.DataFrame(dict)
df.loc[len(df.index)] = [‘Amy’, 89, 93] # L1
The effect of statement L1 will be
(a) It will search for the name ‘Amy’ and return True or False
(b) It will remove the entry , if found
(c) It will add a new row with the data
(d) None of the above

Answer

C

Question 28. Given a dataframe dfBalls created as follows :
import pandas as pd
dfBalls=pd.DataFrame({‘Red’:[10,20,30],‘Green’:[30,40,50],‘Yellow’:[90,100,110]})
The columns of the dataframe will be
(a) 0,1,2,3
(b) 1,2,3,4
(c) Red, Green, Yellow
(d) None of these

Answer

C

Question 29. The symbol © is used for protection of
(a) right to distrubution
(b) right to copy
(c) right to use
(d) right to add

Answer

B

Question 30. Given the following plot , showing the names of 3 students and their percentages :

Class 12 Informatics Practices Sample Paper Term 1 Set A

The code for the above plot should be
( The plotting character used is ‘:’)

Class 12 Informatics Practices Sample Paper Term 1 Set A
Answer

A

Question 31. Statement A CSV files are comma separated.
Statement B Delimiter of CSV files cannot be changed.
(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.

Answer

C

Question 32. The role of the ylabel () function is
(a) to provide the title of the chart
(b) to display the legend of the chart
(c) to display the y-axis label
(d) to provide labels for all the plotted lines

Answer

C

Question 33. The functional idea is protected under
(a) patent
(b) copyright
(c) trademark
(d) None of these

Answer

A

Question 34. The following statements regarding sharewares and proprietary softwares :
Statement A Proprietary software is free , shareware is not free.
Statement B Shareware is free for limited period , proprietary software is not free.
Statement C Proprietary softwares have all rights exclusively with vendor, shareware is made available for trial use.
Statement D Proprietary software is open source, shareware is not open source.
(a) Statement A and Statement B
(b) Statement B and Statement C
(c) Statement C and Statement D
(d) Statement B and Statement D

Answer

B

Question 35. Given the following code:
import pandas as pd
ssd = pd.Series(data=range(2,12,2), index = range(3,16,3))
print(ssd.tail(3))
The output of the code will be
(a) 9 6
     12 8
(b) 9 6
    15 10
(c) 9 6
     12 8
     15 10
(d) Empty set

Answer

C

Question 36. The term ……….. is related to responsible and safe use of Internet.
(a) stalking
(b) bullying
(c) net banking
(d) netiquette

Answer

D

Question 37. A series s1 and s2 are created using the code :
import pandas as pd
import numpy as np
data=np.array([54,76,88,99,34])
s1=pd.Series(data,index=[‘a’,‘b’,‘c’,‘d’,‘e’])
s2=s1.reindex([‘e’,‘b’,‘c’,‘a’,‘d’])
print(s2.loc[‘e’:‘b’]) # Line1
The output of Line1 is
(a) Error in code
(b) Empty set
(c) e 34
     b 76
(d) e 34

Answer

C

Question 38. Mr. Ramnath had sent an abusive mail to his neighbour for threatening him . He was in  a dilemma that how long his digital footprint will remain stored . Clarify his doubt.
(a) 1 month
(b) 2 years
(c) Forever
(d) 1 day

Answer

C

Question 39. Two dataframes whose indexes are same and have all numeric columns can be
(a) added
(b) subtracted
(c) multiplied
(d) All of these

Answer

D

Question 40. Given the code :
import pandas as pd
Numseries=pd.Series([1,2,3],index=[‘a’,‘b’,‘c’])
for q in Numseries:
if q>2:
print(q**3)
The output of the above code is
(a) 3
(b) 27
(c) 1
(d) ‘c’

Answer

B

Question 41. Which of the following are good e-Waste treatment practices?
(a) Throwing them into soil
(b) Donating outdated technology
(c) Giving e-Waste to certified e-Waste recycler
(d) Both (b) and (c)

Answer

D

Question 42. Which of the following can be used to specify a descending order in sorting?
(a) ascending=True
(b) ascending=False
(c) ascending=0
(d) Both (b) and (c)

Answer

D

Question 43. Given two series created as follows :
import pandas as pd
L1=[11,21,31]
S1=pd.Series(L1)
S2=S1+2
print(S1+S2)
Find the output.
(a) 0 23
     1 43
     2 63
(b) 0 21
     1 42
     2 64
(c) 0 24
     1 44
     2 64
(d) None of these

Answer

C

Question 44. A series “Country” has following data :
Index        Value
0               Rome
1               Russia
2               Romania
3               Italy
The command to remove the value ‘Rome’ is
(a) Country.pop(0)
(b) Country.delete(0)
(c) Country.del(‘Rome’)
(d) None of these

Answer

A

Question 45. Jack received a phone call stating that the call was from his Bank and they asked him his ATM card PIN number, this can be
(a) genuine call
(b) case of phishing
(c) case of bullying
(d) All of these

Answer

B

Question 46. Rachana created a series “Perfume” storing the names of her favourite perfumes as indexes and their prices as values . The contents of the series is as follows
Index Value
Rose 6700
Lavender 8900
Wild 2000
Floral 5600
She wrote the command print(Perfume[0:0]) . What will she see?
(a) Rose 6700
(b) Rose 6700
Lavender 8900
(c) No output
(d) Error

Answer

C

Question 47. Anil was using a standalone computer until last month. Since, he has connected his computer to a network he is facing problems like : slow computing, damaged files, etc.
Which of the following actions would keep him safe?
(a) Install an antivirus
(b) Disable cookies
(c) Update his operating system
(d) All of these

Answer

D

Question 48. Given a dataframe “Cellphone” containing the following data :
Index   ModelNo     Type    Brand
0            A22            4G       Samsung
1            N95            3G        Nokia
2           XPS12         2G        Apple
The command that changes the Brand column to values [‘Realme’,’Xiomi’,’Samsung’] would be
(a) Cellphone(‘Brand’)=[‘Realme’,’Xiomi’,’Samsung’]
(b) Cellphone[‘Brand’].change =[‘Realme’,’Xiomi’,’Samsung’]
(c) Cellphone[‘Brand’].modify =[‘Realme’,’Xiomi’,’Samsung’]
(d) Cellphone[‘Brand’] =[‘Realme’,’Xiomi’,’Samsung’]

Answer

D

Question 49. Statement A drop() function removes data from a dataframe temporarily.
Statement B Axis parameter is compulsory with drop() function.
(a) Both statements are correct.
(b) Both statements are incorrect.
(c) Statement A is correct , Statement B is incorrect.
(d) Statement A is incorrect , Statement B is correct.

Answer

A

Section C

(Case Study Based Questions)

Aradhya was trying to store certain data in a data structure and arrange them in a required order . Later on she decided to remove some of the data from the data structure and added another set of data which she wanted to create on the basis of calculations. Finally she wanted to store them in a disk file for permanent storage . She is not sure about some of the lines of code . Help her in writing the code.
The data to be stored is as follows :
      Furniture
Fcode     Fname      Type        Qty
F1         Cot          Wooden      5
F2         Bed          Iron           2
F3         Sofa        Plywood      6

Question 50. The code to create a dataframe for the above would be
(a) import pandas as pd
Furniture=pd.DataFrame({‘Fcode’:[‘F1’,‘F2’,‘F3’],‘Fname’:[‘Cot’,
‘Bed’,‘Sofa’],‘Type’:[‘Wooden’,‘Iron’,‘Plywood’],‘Qty’:[5,2,6]})
(b) import pandas as pd
Furniture=pd.DataFrame({‘Fcode’,[‘F1’,‘F2’,‘F3’],‘Fname’,[‘Cot’,
‘Bed’,‘Sofa’],‘Type’,[‘Wooden’,‘Iron’,‘Plywood’],‘Qty’,[5,2,6]})
(c) import pandas as pd
Furniture=pd.Dataframe(‘Fcode’:[‘F1’,‘F2’,‘F3’],‘Fname’:[‘Cot’,
‘Bed’,‘Sofa’],‘Type’:[‘Wooden’,‘Iron’,‘Plywood’],‘Qty’:[5,2,6])
(d) import pandas as pd
Furniture=p.DataFrame({‘Fcode’:[‘F1’,‘F2’,‘F3’],‘Fname’:[‘Cot’,
‘Bed’,‘Sofa’],‘Type’:[‘Wooden’,‘Iron’,‘Plywood’],‘Qty’:[5,2,6]})

Answer

A

Question 51. The shape of the dataframe is
(a) (2,3)
(b) (3,4)
(c) (4,5)
(d) None of these

Answer

B

Question 52. To add a column “Price” storing [700,12000,25000] the statement would be
(a) Furniture[‘Price’]= [700,12000,25000]
(b) Furniture.’Price’= (700,12000,250000)
(c) ‘Price’= [700,12000,25000]
(d) Furniture.addcolumn= [700,12000,25000]

Answer

A

Question 53. To add a column ‘Amount’ having values ‘Qty’ * ‘Price’ for all the rows the command would be
(a) Amount= Furniture[‘Qty’]* Furniture[‘Price’]
(b) Furniture[‘Amount’]= Furniture[‘Qty’]* Furniture[‘Price’]
(c) Furniture[‘Amount’]= Qty*Price
(d) None of the above

Answer

B

Question 54. She wants to save the dataframe to a CSV file “furniture.csv” . The command she should write
(a) pandas.to_csv(‘c:\\furniture.csv’)
(b) Furniture.to_csv(‘c:\\furniture.csv’)
(c) Any one of (a) or (b)
(d) Dataframes cannot be written to CSV files

Answer

B

Question 55. What command she should use to delete the dataframe permanently?
(a) drop Furniture
(b) del Furniture
(c) remove Furniture
(d) delete Furniture

Answer

B

Related Posts

error: Content is protected !!