A4

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

Questions opt1 opt2 opt3 opt4 opt5 opt6 Answer

A ____ is
an
associativ dictionar sequenc dictionar
list tuple
e array of y e y
key-value
pairs

A _____
is though
similar to
dictionar sequenc
a list, but list tuple tuple
y e
it’s
immutabl
e.

A ___, in
Python,
stores a
sequence dictionar sequenc
list tuple list
of objects y e
in a
defined
order.

What Will
Be The
Output
Of The
Following
Code [1,3,5,7,9 [1,3,5,7,9
[1,2] [8,9] [1,2,3]
Snippet? ] ]
a=[1,2,3,4
,5,6,7,8,9
]
print(a[::
2])
________
_enclose
d dictionar sequenc
list tuple list
between y e
square
bracket

________
_enclose
d dictionar sequenc
list tuple tuple
between y e
parenthe
sis

A subpart
of a tuple
can be
semicolo
retrieved index colon comma index
n
on the
basis of
_______

Elements
of the
dictionar sequenc
______ list tuple tuple
y e
cannot be
updated.

Deleting
individual
element
from dictionar sequenc
list tuple tuple
a_______ y e
is not
supporte
d
_____con
verts the
tuple(seq list(sequ map(seq tuple(seq
sequence none
uence) ecnce) uecnce) uence)
into
tuple.

Processin
g of
dictionar sequenc
Tuples list tuple list
y e
are faster
than
____.

_______
are used
dictionar sequenc
for String list tuple tuple
y e
formattin
g

______ is
an
unordere dictionar sequenc dictionar
list tuple
d set of y e y
key and
value pair

________
_enclose
dictionar sequenc dictionar
d within list tuple
y e y
curly
braces.

The key
and the
value is semicolo
index colon comma colon
separated n
by a
________
________
__ is
mutable.i dictionar sequenc dictionar
list tuple
.e., value y e y
can be
updated

________
_ is
known as
Associativ
e array
since the
dictionar sequenc dictionar
Key list tuple
y e y
works as
Index and
they are
decided
by the
user

_____
statemen
t is used
for
performi del delete remove erase del
ng
deletion
operation
.

____
returns
all the
values() keys() items() clear() items()
key-value
pair of a
dictionary
has_key(k
ey)
returns a char float int boolean boolean
_____
value
update(d fromkeys has_key( get(key) fromkeys

____used
to create
a new
ictionary (sequenc (sequenc
dictionary
from the
sequence

2) e,value1) key) e,value1)


void fruitful key main fruitful
A
function
that
returns a
value is
called
______fu
nction

_______u
sed to
remove
erase() delete() remove() clear() clear()
all items
of a
dictionary

The
________
_objects
are
enclosed
dictionar sequenc
within list tuple tuple
y e
parenthe
sis and
separated
by
comma.
update(d fromkeys has_key( get(key) get(key)

________
method
returns
the value
of the
given key. ictionary (sequenc
If key is
not
present it
returns
none

2) e,value1) key)
Assignm Assignm

________
operators
are used
in Python
to assign
values to
variables.

ent ent

What Will
Be The
Output
Of The
Following
Code
[1,2] [8,9] [1,3,5,7,9] [1,2,3] [1,3,5,7,9]
Snippet?
a=[1,2,3,4
,5,6,7,8,9
]
print(a[::
2])
ValueErr [10, 2, [1, 2, 10, [1, 10, 3, ValueErr

or: or:
What Will
Be The attempt attempt
Output
Of The to assign 20, 4, 30, 20, 30, 20, 5, 30, to assign
Following
Code sequenc sequenc
Snippet?
a=[1,2,3,4
,5,6,7,8,9 e of size e of size
]
a[::2]=10, 6 to 6, 40, 8, 40, 50, 7, 40, 9, 6 to
20,30,40,
50,60 extended extended
print(a)
slice of slice of

size 5 50, 60] 60] 50, 60] size 5


void fruitful key main void

A
_____fun
ction that
perform
action
but don’t
return
any value

What Will
Be The
Output
Of The
Following
Code Syntax error [4, 3, 2] [4, 3] [4, 3, 2, 1] [4, 3, 2]
Snippet?
a=[1,2,3,4
,5]
print(a[3:
0:-1])
random.s random.s random.s

What Is
The
Correct
Comman
d To
Shuffle
The
fruit.shuffle()
shuffle(fruit)huffle(fru huffleList huffle(fru
Following
List?
fruit=['ap
ple',
'banana',
'papaya',
'cherry']

it) (fruit) it)

What Will
Be The
Output
Of The
Following
Code
Key Error 1 {(2,3):2} {(1,2):1} 1
Snippet?
a=
{(1,2):1,
(2,3):2}
print(a[1,
2])

________
_ as a
mapping dictionar sequenc dictionar
list tuple
between y e y
a set of
indices

Paramete
rs
are_____ output inputs sample display inputs
to
functions
The curly
brackets,
{},
dictionar sequenc dictionar
represent list tuple
y e y
an
empty__
______ .

________
is a
statistical histogra histogra
bar chart pie chart line chart
term for m m
a set of
counters

What Will
Be The
Output
Of The
Following
Code
Snippet?

counts = {
'chuck' : 1 0 1 42 100 100
, 'annie' :
42, 'jan':
100}

print(cou
nts.get('ja
n', 0))

>>>a=[9,8
,7,6,5,4]

[9,8,7,6,5 [8, 7, 6, [ 7, 6, 5, [8, 7, 6,


[ 7, 6, 5]
,4] 5, 4] 4] 5, 4]
>>>
a[1:]
>>>a=[9,8
,7,6,5,4]

[8, 7, 6, [9,8,7,6,5 [ 7, 6, 5,
[4, 5, 6, 7, 8, 9] [4, 5, 6, 7, 8, 9]
5, 4] ,4] 4]
>>>
a[::-1]

>>>b=[7,
8,9]
[9,8,7,6,5 [1,2,3,4,5 [ 7, 6, 5, [1,2,3,4,5
[0, 1, 2, 3, 4, 5, 6, 7, 8,9]
,4] ,7,8,9] 4] ,7,8,9]
>>>a.exte
nd(b)

>>>[8, 7,
6, 5, 4, 3,
2, 1, 0] [8, 7, 6, [8, 7, 6,
[1,2,3,4,5 [9,8,7,6,5
[4, 5, 6, 7, 8, 9] 5, 4, 3, 2, 5, 4, 3, 2,
,7,8,9] ,4]
1, ] 1, ]
>>>a.pop
(0)
_____ is
immutabl
e so
changes
cannot be
done on dictionar sequenc
list tuple tuple
y e
the
elements
of a tuple
once it is
assigned.
>>>a={1:
'ONE', 2: ([(1,
'two', 3: {1: 'ONE', 'ONE'),
'three'} 2: 'two', dict_keys dict_keys dict_keys
(2, 'two'),
3: ([1, 2, 3]) ([0, 2, 3]) ([1, 2, 3])
(3,
'three'}
>>> 'three')])
a.keys()
________
___is a dictionar sequenc
list tuple tuple
Heteroge y e
neous
In
________
,Slicing dictionar sequenc dictionar
list tuple
y e y
can't be
done

Which of
the
following
statemen
{} set() [] () set()
ts is used
to create
an empty
set?

What is
the
output of
the
following
piece of
code Error, no
when Error, method
executed duplicate called
in the {2,3} item intersecti {1,4,5} {2,3}
python present on_upda
shell? in list te for set
a={1,2,3} data type

a.intersec
tion_upd
ate({2,3,4
,5})
a
Which of
the
following s={4,
s={2, 2.2,
lines of s={abs} ‘abc’, s={san} s={san}
3, ‘xyz’}
code will (1,2)}
result in
an error?

hat is the
output of
the line
of code
shown No
1 Error 0 1
below, if output
s1= {1, 2,
3}?
s1.issubs
et(s1)

You might also like