0% found this document useful (0 votes)
104 views4 pages

Second Unit Test 2022: Radha Madhav Public School Bareilly

The document contains a test for computer science class with 40 multiple choice questions related to Python lists and tuples. It covers topics like list operations, tuple operations, indexing, slicing and other methods related to lists and tuples.

Uploaded by

Raghav Agarwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
104 views4 pages

Second Unit Test 2022: Radha Madhav Public School Bareilly

The document contains a test for computer science class with 40 multiple choice questions related to Python lists and tuples. It covers topics like list operations, tuple operations, indexing, slicing and other methods related to lists and tuples.

Uploaded by

Raghav Agarwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

RADHA MADHAV PUBLIC SCHOOL BAREILLY

Second Unit Test 2022


Sub: Computer Science
Duration: 01 Hour CLASS XI MM 40
Section: A

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?

Q15. To insert 5 to the third position in list1, we use which command?

Q16 Name and two membership operator in Python?


Q17. What is List slicing? Give Example?
Q18. Which function is used to arrange the list items in a particular order either
ascending order or descending order?
Q19. What will be the output of the following Python code?

>>>t=(1,2,4,3)

>>>t[1:3]

Q20. If a=(1,2,3,4), a[1:-1] is _________


SECTION: B

Q21. What will be the output of the following Python code?


>>>t = (1, 2)
>>>2 * t

Q22. What will be the output of the following Python code?


>>>my_tuple = (1, 2, 3, 4)
>>>my_tuple.append( (5, 6, 7) )
>>>print len(my_tuple)

Q23 What will be the output of the following code segment?

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.

Q25. What will be the output of the following code segment?

list1 = [10,20,30,10,40,10]

print(list1.index(10))

Q26. What is the data type of x after the following statement?

x = [7, 8, 9, 10]

Q27. What is the data type of x after the following statement?

x = [‘Today’, ‘Tomorrow’, ‘Yesterday’]


Q28. What will be the output after the following statements?

x = [25, 35, 45]

y = x[0]

print(y)

29. What will be the output after the following statements?

x = [10, 20, 30]

y = x[1] + x[2]

print(y)

Q30. What will be the output after the following statements?

x = [15, 45, 85, 95]

print(x[3]-x[1])

Q31. What will be the output after the following statements?

x = [5, 4, 3, 2, 1]

print(x.pop(3))

Q32. What will be the output after the following statements?

x = [5, 4, 3, 2, 1]

y = [10, 5, 0]

x.extend(y)

print(x)

Q33. Find the output:

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))

35. Write the output of the following:

a=(23,34,65,20,5)
s=0
for i in a:
if i%2==0:
s=s+a[i]
print(s)

Q36. Write the output of the following:

a=(1, 2, 3, 2, 3, 4, 5)
print(min(a) + max(a) + a.count(2))

Q 37. Which mathematical operator is used to replicate a tuple?

Q 38. Write the output of the following:

t1 = (23, 45, 67, 43, 21, 41)

print(t1[1:2])

Q 39 Write the output of the following:

a=(“Amit”, “Sumit”,”Ashish”,”Sumanta”)
print(max(a))

Q 40. Write the output of the following:

a="blog"
b=list(a)
c=tuple(b)
print(c)

______________________________________________________________________
______________________________________________________________________

You might also like