pop()
delete()
remove_last()
delete_last()
What will be the output of the following Python code?
>>>max("what are you")
what
y
a
Error
White Space
,
e
S
What will be the output of the following code?
list1=[2,33,222,14,25] print(list1[-1])
2
33
14
25
a=((0,2,3,4)[1:-2]) print(a)
(3,)
(2, )
(1,)
(0,)
list.contains(value)
list.index(value)
value in list
Yes, list mutable and tuple immutable
No, list and tuple both are mutable
No, list and tuple both are in immutable
No, just opposite, list immutable and tuple mutable
dictionary()
set()
tuple()
list()
count()
upper()
strip()
All the above
List of tuple
Tuple of List
Array of Tuples
Invalid Type
Union
Intersection
Difference
None of the above
What is the output of the following program:
print ("Hello World"[::-1])
dlroW olleH
Hello Worl
D
error
What will be the output of the following code snippet?
a=[1,2,3,4,5,6,7,8,9] a[::2]=10,20,30,40,50,60 print(a)
ValueError: attempt to assign sequence of size 6 to extended slice of size 5
[10, 2, 20, 4, 30, 6, 40, 8, 50, 60]
[1, 2, 10, 20, 30, 40, 50, 60]
[1, 10, 3, 20, 5, 30, 7, 40, 9, 50, 60]
What is the correct command to shuffle the following list?
fruit=['apple', 'banana', 'papaya', 'cherry']
fruit.shuffle()
shuffle(fruit)
random.shuffle(fruit)
random.shuffleList(fruit)
Tuples have structure; lists have an order
Tuples are homogeneous, lists are heterogeneous.
Tuples are immutable, lists are mutable.
All of them
What is the output of the following code:
L=['a','b','c','d'] print ( "".join(L))
None
abcd
[‘a’,’b’,’c’,’d’]
. List is mutable & Tuple is immutable
List is immutable & Tuple is mutable
Both are mutable
Both are immutable
Sequence value pair
Key value pair
Tuple value pair
Record value pair
Removes all spaces from the string.
Removes the first and last character of the string.
Removes whitespace from the beginning and end of the string.
Converts the string into a list of characters.
startswith()
startswith_prefix()
startswithwith()
startswiths()