What is the output of the following code ?
ms = ('A','D', 'H','U','N','I','C') print(ms[1:4])
(‘D’, ‘H’, ‘U’)
(‘A’, ‘D’, ‘H’,’U’,’N’,’I’,’C’)
(‘D’,’H’,’U’,’N’,’I’,’C’)
What is the output of the following statement ?
print ((2, 4) + (1, 5))
(2 , 4), (4 , 5)
(3 , 9)
(2, 4, 1, 5)
Invalid Syntax
What is the output of the following code?
a = {1:"A", 2: "B", 3: "C"} b = {4: "D", 5: "E"} a.update(b) print(a)
{1:’A’, 2: ‘B’,3: ‘C’}
{1: ‘A’, 2: ‘b’, 3: ‘c’, 4: ‘D’, 5: ‘E’}
Error
{4: ‘D’, 5: ‘E’}
23
'2+3'
'23'
None of These
[3, 4, 5, 20, 5, 25, 1, 3]
[1, 3, 3, 4, 5, 5, 20, 25]
[3, 5, 20, 5, 25, 1, 3]
[1, 3, 4, 5, 20, 5, 25]
What will be the output of the following expression?
a = 2 b = 8 print(a|b ) print(a >> 1)
10 0
10 2
2 2
10 1
what is the output of the following code?
M=['b' *x for x in range(4)] print(M)
['', 'b', 'bb', 'bbb']
['b,'bb', "bbb', "bbbb']
['b','bb', bbb']
none of these
What is the output of the following?
print(max([1, 2, 3, 4.] [4, 5, 6], [7]))
[4,5, 6
[7]
[1, 2,3, 4]
7
What will be the output of the following?
print(sum(1,2,3))
error
6
1
3
What will be the output of the following Python code?
list1=[1,3]
list2=list1
list1[0]=4
print(list2)
[1, 4]
[1,3, 4]
[4,3]
[1,3]
anywhere in between the file
End
beginning
second line of the file
list
set
tuple
dict
tuple1=(5,1,7,6,2) tuple1.pop(2) print(tuple1)
(5,1,6,2)
(5,1,7,6)
(5,1,7,6,2)
list1.sum(5)
list1.add(5)
listl.append(5)
list1.addelement(5)
Which of the following will delete key-value pair for key="tiger" in dictionary?
dic-"lion":"'wild","tiger":"'wild",'cat":"domestic","dog":"domestic"}
del dic("tiger"]
dic["tiger"].delete()
delete(dic.["tiger'])
del(dic.["tiger"])
d1={"abc":5,"def":6,"ghi":7} print(d1[0])
abc
5
{"abc":5}
count()
strip()
upper()
उपरोक्त सभी
getkeys ()
key()
keys()
None
del
remove
removeAll
None of these
list1.addEnd (5)
list1.addLast (5)
list1.append (5)