Q1
a = [10, 20, 30]
a.append(40)
print(a)
a[3] = 50
print(a)
What is the final output of the list 'a' above?
Q2
a = [10, 20, 30]
a.append(40)
a[4] = 50
print(a)
What is the output when you run the above set of statements?
Q3
a = [10,'20', True]
print(type(a[2]))
What is the output of the above code?
Q4
a = (10,'20', True)
a.remove(10)
print(a)
What is the output of the above code?
Q5
a = [10, 20, 30]
a[0] = 40
print(a)
What is the output of the above code?
Q6
a = [10, 20]
print(len(a))
What is the output of the above code?
Q7
a = [10, 'b', [2, 20, 30], False]
In the above code, you see that the third element of list 'a' is another list. You are required to change the second element '20' of this inner list to '50'. I.e., after the change, your list would be
a = [10, 'b', [2, 50, 30], False]
Choose the statement which can make this change
Q8
a = [10, 'b', (2, 20, 30), False]
In the above code, you see that the third element of list 'a' is a tuple. You can change the second element '20' of this tuple to '50' because it is inside a list
Q9
a = [10, 'b', (2, 20, 30), False]
a[2] = 40
a
What is the output of the above code segment?