Built in
List
Tuple
Derived data
getkeys()
key()
keys()
none of the mentioned
List is mutable & Tuple is immutable
List is immutable & Tuple is mutable
Both List and Tuple are Mutable
Both List and Tuple are Immutable
What data type is the object below ?
L=[1, 23, 'hello', 1]
Dictionary
Array
dlroWolleH
Hello Worl
d
Error
print s[0]
print s.lower()
s[1]='r'
print s.strip()
wd[4:]
wd[:4]
wd[-5:]
wd[:-4]
What is the output of the following code?
dict={"Joey":1, "Rachel":2} dict.update({"Phoebe":2}) print(dict)
{'Joey': 1, 'Rachel': 2, 'Phoebe': 2}
{“Joey”:1,”Rachel”:}
{“Joey”:1,”Phoebe”:2}
delete all the trailing whitespace characters
delete all the leading whitespace characters
delete all the leading and trailing whitespace characters
delete upper case characters
a = set('dcma') b = set('mlpc') print(a^b)
{‘d’, ‘c’, ‘m’, ‘l’, ‘p’, ‘c’}
{‘m’, ‘l’, ‘p’, ‘c’}
{‘d’, ‘c’, ‘m’, ‘a’}
None of These
Set
None of the Above
arr[-2]
arr[2]
arr[-1]
arr[1]
What will be the output of the following ?
print((range(4)))
0,1,2,3
[0,1,2,3]
range(0, 4)
(0,1,2,3)
list=()
list.null
null.list
list=[]
What does the following code print ?
x = 'mohan' for i in range (len(x)): x[i].upper() print (x)
mohan
MOHAN
set
tuple
string
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
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’}
{4: ‘D’, 5: ‘E’}