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

1.

Finish the code below

Answer papl

2. If a={1,2,3}, what happens when a.add(1) is executed?


a. a={1,2,3}
b. a={1,1,2,3}
c. Error as 1 already exists in the set

3. In which case the TypeError meseage appears?


a. When asterisk output is used
b. When parameters are used
c. When numbers of arguments are not matching

4. Inside a function assignment statement creates which variable?


a. Global
b. Double
c. Local
5. What is the output of code bellow

Output: 123

6. Which of the following is a Python Tuple?


a. {1, 2, 3}
b. [1, 2, 3]
c. (1, 2, 3)
7. How to convert dictionary data type into json?
a. By using chage__ function
b. By using provide function
c. By using dump function
8. How empty lis is created?
a. With //
b. With []
c. With {}
9. Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1]?
a. 2
b. 25
c. none
10. Fill in the gap: “In the list, the values (or items) are distinguished by using a ____
inside the [].”
a. dot
b. slash
c. comma
11. Determine the output of the following code:

a. [1, 2, 3, 4, 5, 6, 7, 8, 9]
b. [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
c. [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
12. What is the one type of file that expresses structural data through data text document?
a. HTML
b. XML
c. JSON

13. Complete the code:

Answer: _del_________

14. Which of the following is not a core data type?


a. class
b. tuple
c. list
15. Why ValueError occurs in code below?

a. There is shouldn’t be “:” in line 2


b. There is not 3 list items
c. Code is not finished
16. Determine output of the code

Output: 4 5 6

17. File is…


a. None of them
b. Space used to store shortcuts on a computer
c. Logical unit used to store data in a computer’s storage device
18. As the result of code below TypeError occurs. Why?

a. Dictionary does not support comparison operators


b. There are no values
c. Function does not accept variables
19. Set can be made from
I. Tuple
II. List
III. Method
IV. Function
V. Dictionary
a. III and V
b. IV and I
c. I and II

20. Dictionary item is defined by …


a. Being connected with a colon as [key] : [value]
b. Being connected with a colon as [argument] : [parameter]
c. Being connected with a colon as [key] : [conditional]

You might also like