Accountancy Question Paper pt-3
Accountancy Question Paper pt-3
1. The data type list is an ordered sequence which is made up of one or more elements.
(a) Mutable (b) Immutable (c) Both a and b (d) None of the above
2. What will be the output of the following python code
new_list = [‘P’,’y’,’t’,’h’,’o’,’n’]
print(len(new_list))
(a) 6 (b) 7 (c) 8 (d) 91
3. Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1]?
(a) Error (b) None (c) 25 (d) 2
4. Suppose list1 is [1, 3, 2], What is list1 * 2?
(a) [2, 6, 4] (b) [1, 3, 2, 1, 3] (c) [1, 3, 2, 1, 3, 2] (d) [1, 3, 2, 3, 2, 1]
5. Write the output of the following code:
>>>L=[1,2,3,4,5,[6,7,8]]
>>>print(L[5])
(a) [6, 7, 8] (b) 6, 7, 8 (c) Error (d) 6
6. What is the length of the given tuple? >>> t1=(1,2,(3,4,5))
(a) 1 (b) 2 (c) 3 (d) 4
7. Which of the following is not a tuple?
(a) P = 1,2,3,4,5 (b) Q = (‘a’, ‘b’, ‘c’) (c) R = (1, 2, 3, 4) (d) None
8. Which of the following is/are features of tuple?
(a) Tuple is immutable (b) Tuple is a sequence data type.
(c) In tuple, elements are enclosed in Parenthesis (d) All of the above
9. Which of the following is not a function of tuple?
(a) update( ) (b) min( ) (c) max( ) (d) count( )
10. What type of error is returned by following code :
a=(“Amit”, “Sumit”,”Ashish”,”Sumanta”)
print(a.index(“Suman”))
(a) Syntax Error (b) Value Error (c) Type Error (d) Name Error
11. A) What do you understand by mutability?
B) What will be the output of the following code?
L=[3, 5, 1, 10, 2]
L.append(55)
print(L)
12. Write a program that inputs two tuples and creates a third, that contains all elements of the
first followed by all elements of the second.
13. Consider the following list L=[13,18,20,10,18,23] Write python statements to perform
(a) Count number of times the value 18 is repeating
(b) Arrange values in descending order
(c) Insert 15 at index position 3
14. A) What is the difference between a List and a Tuple?
B) How to create an empty tuple? Also create a single element tuple.