Đề 3 – Bài tập, đề thi trắc nghiệm online Lập trình Python

Đề 3 – Bài tập, đề thi trắc nghiệm online Lập trình Python

Đề 3 – Bài tập, đề thi trắc nghiệm online Lập trình Python

Số câu30
Quiz ID11578
Câu 1
1. What will be the output of `print(bool(0), bool(1), bool(''))`?
Câu 2
2. What is the purpose of a generator in Python?
Câu 3
3. Which of the following data structures is immutable in Python?
Câu 4
4. Which of the following is NOT a built-in data type in Python?
Câu 5
5. In Python, what is the purpose of the `len()` function?
Câu 6
6. What is the output of `print('Hello'.replace('l', 'L'))`?
Câu 7
7. What does the `pip` command stand for in Python?
Câu 8
8. What is the role of the `self` parameter in Python class methods?
Câu 9
9. Which method is used to add an element to the end of a list in Python?
Câu 10
10. What is the purpose of the `__init__` method in a Python class?
Câu 11
11. Which of the following is a built-in function in Python for reading input from the user?
Câu 12
12. What is the purpose of the `try...except` block in Python?
Câu 13
13. Which of these loop types is NOT available in Python?
Câu 14
14. What is the output of the following Python code? ```python print(3 > 5 and 10 < 20) ```
Câu 15
15. What is the purpose of virtual environments in Python?
Câu 16
16. What does the `continue` statement do in a loop in Python?
Câu 17
17. What is the purpose of list comprehension in Python?
Câu 18
18. What is the primary purpose of the 'if __name__ == '__main__'' block in a Python script?
Câu 19
19. What is the difference between `==` and `is` operators in Python?
Câu 20
20. What is a dictionary in Python?
Câu 21
21. Which of the following statements about Python lists is FALSE?
Câu 22
22. What will be the output of the following Python code snippet? ```python x = 5 def modify_x(val): x = val modify_x(10) print(x) ```
Câu 23
23. What is the output of `print('Python'[1:4])`?
Câu 24
24. Which of the following is NOT a valid way to comment in Python?
Câu 25
25. What is a module in Python?
Câu 26
26. Which of the following is a correct way to open a file named 'myfile.txt' in read mode in Python?
Câu 27
27. What is a decorator in Python?
Câu 28
28. What is the output of `print(type([1, 2]))` in Python?
Câu 29
29. What is the purpose of the `pass` statement in Python?
Câu 30
30. What is the difference between function arguments `*args` and `**kwargs` in Python?

Để lại một bình luận