Endterm v3D

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

1. In which code double for loop used to print the jagged list?

a.

b. answer is b

c.

2. Fill in the gap: “List is a Python data structure that can contain multiple items and
replace ______ values. Supports extraction of ______ values from saved items.”
a. external; necessary
b. internal; necessary
c. internal; last
3. Determine the output of the following code:

a. [11, 22, 33, 44, 55, 66]


b. [11, 22, 33, 44, {55, 66}]
c. [11, 22, 33, 44, [55, 66]]
4. How to get last element of list in python? Suppose we have list with name arr,
contains 5 elements.
a. arr[0]
b. arr[5]
c. arr[-1]
5. Fill the gaps: “To access the elements of a t-wdoimensional list or allocate values to
the elements, use _______ twice after the lisatnd specify a row index and a column
______ within [ ]”

a. Method, address
b. {}, function
c. [], index
6. What is needed to use in code below?
a. Nothing
b. Finally clause
c. Method
7. Using for with two-dimensional list, return the list of the elements from the last to the
first
a. True
b. False

8. Determine the output of the following code:

a. False
b. True
c. SyntaxError: Invalid syntax
9. What will be the output of the following code:

a. Banana
b. Orange
c. Syntax Error
10. What method is?
a. A function attached to an object dealt with an object-oriented programming
b. A value passed to a function when calling the function
c. A function which returns an asynchronous generator iterator
11. Where arbitrary parameters are used?
a. tuple
b. list
c. both of them
12. Determine the output of the following code:

a. 8.0 and 18.0, 6.0


b. 1.0 and 1.0
c. 2.0 and 2.0
13. What is used to add new item to the jugged list?
a. +
b. Append method
c. Adding function
14. Which statement is correct?
a. List is immutable and Tuple is mutable
b. List is mutable and Tuple is immutable
c. Both are mutable
15. Fill the gaps “In list the index of first value starts with ___, which is automatically
_______”

a. 0, identified
b. 1, used
c. 0, assigned
16. Determine the function of the following syntax: a_list[-2:]
a. Slicing two items from the end
b. Slicing entire items from the start except for the last two items
c. Slicing the first two items in reverse order
17. Put the size of the row and column in for in range and index them to …
a. Identify size of 2 dimensional list
b. Print the elements in the list
c. Returns row size
18. Which code gives output bellow?
0
00
000
0000
00000

a.

b. b answ er

c.

19. What is used to add new contents to the back of a life that has already been created?
a. a+
b. add
c. +++

20. Which is not string methode?


a. Count
b. Avg
c. Both of them

You might also like