0% found this document useful (0 votes)
45 views6 pages

12th Pre Board IP Question

Informatic practice 065

Uploaded by

lpsi.fatema
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views6 pages

12th Pre Board IP Question

Informatic practice 065

Uploaded by

lpsi.fatema
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

L.

P SAVANI
S C I O O

,
L ,

PAL,
PAI

INTERNA
V A T I O N A I

P R E - B O A R D S

SCIENCI:
O83

DAT:U10 2021 SUBECT:


1PUTER
TIM 90 Minutes
STD NU MARKS 35 M

General ustruetions:
The question paper is
divide
Section A consists of 25. into 3 Sections- A, B, andC.
24 Questions
-

Section Bconsists.of (1-25). Attempt:


Questions (26-49).
Section C consists ofo case
npt any 20 question.
l l questions study Attempt any 20 questions.
carry equal mark based Questions
Questions (50-55).
Sd
(50-55). Atteup
Attempt any que >

Given an object SECTION-A


What will be the objl= (10, 20, 30, 40, 50, 60, 70, 80, 90).
output of
a. (40.50,00,70,s0)
print(objl[3:7:2)
print(obj[3:7:2])?
b. (40,50,60,70))
c. (40,50,60) d.
(40,60)
Which of the
a. It we try to tollowing statements is not correct?
read a text tile
bIf we try to read a text file thatthat
does not exist, an error
oceurs.
c. If we
try to write on a text file does not exist, the file gets ereated.
d. If we try to write that does not exist, no
on a text file error occurs.
that does not exist, the
file gets created.
Is the
following Python code valid?
S>a-(1,2,3.4)
>>del a
a) No because tuple is immutable
eYes, the entire tuple is deleted 6)Yes, first element in the tuple is deleted
If the value of a 20 and b
d) No, invalid syntax for
=
=
20, then a+=b will del method
assign to a
40 b)30 c) 20
Find the operator which cannot be used with a string in d) 10
a)in Python.
b)*
Which of the d)@0+
a. mytile
following options can be
used read first line of a
to the
b.
open('Myfile.txt);
=

print(myfile.read(line)) text file "Mvtile.txt"?


myfile =open('Myfile.txt,r); print(mytile.read(1))
emytile =open('Myfile.txt): print(mytile.readline(0)
d. myfile
open('Myfile.txt); print(mytile.readlines())
=

Which methods are used to write and


read into/from a
binary file?
a) dump() and load() b) writer0 and icuceU C} both (a) and (b) d)
None of the above
8 Assume that the position of the file po
the beginning of 3rd line in a
Which of the following options can be used to read text file.
all the
a. myfile.read(n-3) b. myfile.read(n) remaining lines?
c. myfile.readline( ) Admyfile.readlines()
ofthe follow
which following will result inan error
40],
20, 30,
9.
Conside a list
Onsider
L-[10, L
)L
*=2 S50
d)L[1] =

L[O+=2
b) L[3]=5/2f o l l o W i n g code:-
10 output of
the
!= 1) o r (4 9)
<
What w
will be the
print((4>and (2
5) b)(4> 5) and (2!=1) or (4<9)
a) (4> 5) (2!=1) (4< 9) d) False
invalid
True named DAYS
=
CSUN, 'MON"', 'TUES'). Identifythe id
11 Consider a tuple in python statements:-

statement(s) from
the given below
b) print(DAYS[2]))

a) S DAYS[O] d) LISTI
=
list(DAYS)
DAYS[I]= *WED function:
is a wrong way of defining a
Which of the following b) def f{x, y, 2)
z=30)
(a) def f(x=10, y=20, d) def f(x, y=20, z=30)
V) def fx=10, y, z) to be imported, in order to interact
with binary files?
13 Which Python module needs
a)binary b) bin) pickle d) burger
variable name?
14 Which of the following is valid
c)%name% d)Block_number
a) Student name b) 3Number
the
15 A statements skips the rest of loop and jumps over to the statement following
loop
a) continue bbreak c)loop d) sequence
files?
Which of the following is incorrect in the context of binary
statements
16
information is held in memory.
a. Information is stored in
the same format in which the
translation takes place.
b. No end of line (EOL) character
eEvery line ends with a new line character.
d. pickle module is used for reading writing.
and
string tc. a float in python?
of the following function
convert a
17 Which
b) float[x, base] c) float(x) d) str(x)
a)What
in[x.base
is the data type of a= (1)?
18 d) Both tuple and integer
c) List
aTuple b) Integer
where myfile is the
function in Python is myfile.seek(offset, reference_point)
19 Syntax of seek
default value of reference_point?
file object. What is the
C. 2 d. 3
b.1

20 In File=open("ABC.txt"), name offile object is


(b) ABC.txt CFile (d) File=open)
(a)open
What is the output of the following code:
21 print 9/2
c) 4.0 d) error
a) 4.5 y4
is syntax of an if statement.
22 a.
If condition:
b) if statement:

elif: Condition

condition:
c i f condition: d) if elif
elif: Statement
Statements -

What is the type of following result? 1+2.0 +3


23 c) double d) complex
a
Integer tloat
Consider string atr*
Write A
Uriend I deed"
To statement
display in
Strf0:41 the last fourpython to impi mplement following:

d) str[4]
25 A
loop that never characters
b) str: -1] s t r ( - 4 : ]

a) Continue loop ends is


OCircle loop called a:
b ) Infinite loop
these
d) None of
This
26 What section
is the consists of SECTION-B
T-(100) output of 24
the Questions (26 to 4). Attempt any 20 questionss
print(T 2) following code?
27
a. Syntax error
What will be the b. (200,)
t(1,2,4,3) output of the C.200 d. (100,100)
t[1:-1] following Python codee?
a) (1,2)
28 What is the b)(1,2, 4) 2,4)
output of the
i=0 following code d)(2,4,3)
while i< 3:
print i
it=1
print i+1
021324 b) 012345
29 Predict output c) error d) 102435
nameList ['Harsh', 'Pratik',
=

'Bob', 'Dhruv]
pos nameList.index("GeeksforGeeks")
print (pos * 3)

a) GeeksforGeeks GeeksforGeeks GeeksforGeeks


b) 'Harsh "Harsh"Harsh'
eValucError: GecksforGeeks' is notin list
30 Identify the output of the following Python statements.
x 2
whilex < 9:
print(x, end=")
x=x+1
a. 1 23 4 56 78 b . 3 4 5 6 789 2 3 45678 d. 234 56789
31 Predict output
d {"john":40, "peter":45}
print(d["john"])
b) 45 c)peter djohn"
ohn
a40 following Python
code?
What will be the output of the
32
32
>>my_tuple
=
(1, 2, 3, 4)
>>>my_tuple.append( (5, 6, 7))
>>>print len(my_tuple) dError
c)5
b) 2
a)
33 What is the output of the following program:
i= 0
while i< 3:
print i
it= 1
else:
print 0
a) 01230 b)0 1 23 e0120 derror
34 Identify the output of the following Python statements.
Istl [10, 15, 20, 25, 30]
=

Ist1.insert( 3, 4)
Istl.insert( 2, 3)
print (lstl[-5])
a..2 b3 C. 4 d.20
35 Suppose a list L is declared as L=[h','e',1,'1,'°], then what will be the output after these
statements:
L[O-M
M=L
M[2]FD'
M[3]=10
print(M,end=* *
print(L)
a TM, 'e, D', 10, 'o'] (M,'e, 'D', 10,'o]
b) ['M,'e,'D,1,°'] ['h','e', T, T ;o']
c)[h','e', T, T,o'] ['M,'e, D', 10,'o]
d)[M, 'e, D, 10,'o |'M, e, D, T,o|
36 Suppose L=[11,12,13,14,15] then what will be the output for print(L[:3]+L[1:6:2])
(a) [11, 12, 13, 12, 13] 6) [11, 12, 13, 13, 14)
(c [11, 12, 13, 12, 14] d)[11, 12, 13, 14, 15
37 Predict the output
a-("Check"}'3
print(a)
a) (Check','Check','Check")
b)Operatornot valid for tuples
cACheckCheckCheck")
d) Syntax error
37 What will be the output of the following Python code?
i=0
while i< 5:
print(i)
i+1
ifi=3:
break
else:
print(0)
a) 0 120
by012
What will be the output of the
c)error d) none of the mentioned
38 following Python code
x"abcdef"
while i inx: inetdfae
print(i, end=" ")
a)abedef
b) abcdef c)iiiiii. d e r r o r in code
What will
be the
x= "abedef"
i= "a" output of thee following
while i inx: follow ing
print(i, Pytho
ython code
a) no outputend = "
")

a biiiii...
a aa aa
40 d)abe def
What is the
a) 27 output of the
41
What will be expression 3*1**
b9
x='abcd' the output of the d)3
for i in x: following Python code?
coue
print(i.upper())
a) abcd
bABCD
c)aBC D
d)error
42 What type of data is:
a) Array
of tuples bList tuples a=[(1.).(2.4)%M3.9)?
43 What is the of
output of print str|2:5] if str
c)Tuples of lists d) Invalid type
=
'Hello World!"?
a)llo World! b)H Lello d) ello
44 What is the output
of following code?
X4.5
y 2
print x/y
a. 2.2 Lb}2.0 c)2.1 d) 2.25
45 for i in range(int(2.0):
print(i)
a) 0.0 1.0 br01c) error d)none of the mentioned
46 What will be the output of following code?
x.y=10,8
X,y= y,x+2
print(x.y)
b) 10,12 Lc)8,12
a)10, 8 d) 12,10
47 Predict the output:
X=40
Y-X+1
X=20,Y+X
print(X, Y) c) 20, 40, 41
by(20, 81) 41
a)20.40 d)error in code
a ,b.c-2,3,4
48 a,b.ba*a, a*b, a*c
b, c)
(a,b.
print( a
a)4 8 16
,

b)4 64
48 4
Predict output:

5.6.18.
alst=[1,2,3,4,5,6,7,8,9]

print(alLstf: :3))
234
49 c. [1,2,3
b. [2,3,4)
a. [4,7,8] 1,4, 7]
Sectioof6Qu Study based Questions
Case
Section-

consists Questions (50-5. Attempt


ma centre, is learning CSV any 5
Mohan, new
This
a
section
his st a coaching
of
of a coac incomple python
student ile Module questions.
in Python.
training, he has been
raining, en assigned
assigown
an

shown below).
code (shown below) to create During
reate aa CSV
CSV
below). Help him i
in
File Employee.csv'
'Employee
the desired CSV File.
(content
completing the code which creates
CSV File

#Statement-1 101, AKSHAY, IT, 50000


import 202, ABHISHEK, IT, 45000
th = open newline=") #Statement-2 303, ARVIND, IT, 65000
empwriter = csv. #Statement-3 404, RAVI, IT, 55000
data [] 505, ASHISH, IT, 43000o
header =['EID', 'ENAME', 'DEPARTMENT",
'SALARY"
data.append(header)
for i in
eid
range(5):
ename
int(input("Employee ID: ")
=

input("Enter Name: ")


dept input("Enter Department: ")
sal
rec
=

input("Enter Salary: ")


data.append(rec) #Statement-4
stuwriter. (data)
fh. () #Statement-5
#statement 6
50 ldentity the suitable code
ay csv for blank space in line
marked as Statement-i.
51 ldentiry the CsV
missing code' for blank space c)pickle d) os
a) "Employee.csv""a" in line marked as
State
52
"Employees.csv","r
Choose the
Employees.csv","w" c"Employee.csv","r" d)
functionname
marked as Statement-name (with
(with argument)
argt that should be used the in
3 blank space of
a) reader(fh) line
53 Identify the suitable
data.
reader(MyFile)
code for writer(fh) d) writer(MyFile)
a) 'eid',
blank pace in line marked as
ement-4 to write the
input
'ename',
c) both (a) and (b)dept', 'sal'
Sar
b}cid,ename,dept,sal
Choose the d) None of the these
54 function name
Statement-5 to name that should be used in the blank of line
create the desired space marked aS
a)dump()0 o CSV File?
55 Choose the function b) load() c) writerows() d)writerow()
Statement-6 ame that should be used in the blank space of line
markedas
a)abe
b) open cclose() d) end()
ALL THE BEST

You might also like