Second Unit Test 2022: Radha Madhav Public School Bareilly
Second Unit Test 2022: Radha Madhav Public School Bareilly
Q1 What is List?
Q2 What is Tuple?
Q3. List Some Mutable Types in Python?
Q4 What is the difference between Mutable and immutable types in python?
Q5 List Some Immutable types in python?
Q6. What is the difference between list and tuple?
Q7. What is Empty tuple? Give Example?
Q8 What is Singleton Tuple? Give Example?
Q9 What is Homogenous Tuple? Give Example?
Q10 What is Heterogeneous Tuple? Give Example?
Q11 Which operator is used to concatenate two list in python?
Q12. What is the use of * operator in python?
Q13. Suppose list1 is [1, 3, 2], what is list1 * 2?
Q14. Which list function is used to add a new element in the end of a list?
>>>t=(1,2,4,3)
>>>t[1:3]
L=’good’
L=[1,2,3]
n=2
print(L*n)
Q24.
pop() returns the element whose index is passed as argument to this function
and also removes it from the list. If no argument is given, then it returns and
removes the _____element of the list. Fill in the Blank Space.
list1 = [10,20,30,10,40,10]
print(list1.index(10))
x = [7, 8, 9, 10]
y = x[0]
print(y)
y = x[1] + x[2]
print(y)
print(x[3]-x[1])
x = [5, 4, 3, 2, 1]
print(x.pop(3))
x = [5, 4, 3, 2, 1]
y = [10, 5, 0]
x.extend(y)
print(x)
L = [1, 3, 5, 7, 9]
print(L.pop(-3), end = ‘ ‘)
Q 34. Write the output of the following.
a=(23,34,65,20,5)
print(a[0]+a.index(5))
a=(23,34,65,20,5)
s=0
for i in a:
if i%2==0:
s=s+a[i]
print(s)
a=(1, 2, 3, 2, 3, 4, 5)
print(min(a) + max(a) + a.count(2))
print(t1[1:2])
a=(“Amit”, “Sumit”,”Ashish”,”Sumanta”)
print(max(a))
a="blog"
b=list(a)
c=tuple(b)
print(c)
______________________________________________________________________
______________________________________________________________________