#1
Which of the following data types is mutable in Python?
1 answered
#2What will be the output of the following code?
What will be the output of the following code?
```
print(2 + 2 * 3 - 2 / 2)
1 answered
#3
What is the purpose of the 'pass' statement in Python?
1 answered
#4What is the output of the following code?
What is the output of the following code?
```
print(10 / 2)
1 answered
#5
Which of the following is not a valid data type in Python?
1 answered
#6
Which of the following statements is true regarding Python's 'pass' statement?
1 answered
#7What will be the output of the following code?
What will be the output of the following code?
```
print(3 < 4 < 5)
1 answered
#8
Which of the following is the correct way to open a file named 'data.txt' for writing in Python?
1 answered
#9What is the output of the following code?
What is the output of the following code?
```
my_list = [1, 2, 3]
print(my_list[3])
1 answered
#10
What is the time complexity of searching for an element in a binary search tree (BST) in the worst-case scenario?
1 answered
#11
Which of the following sorting algorithms has the worst-case time complexity of O(n^2)?
1 answered
#12What will be the output of the following code?
What will be the output of the following code?
```
def foo(x, y=[]):
y.append(x)
return y
print(foo(1))
print(foo(2))
1 answered
#13What will be the output of the following code?
What will be the output of the following code?
```
print('hello'.capitalize())
1 answered
#14
In Python, what is the result of '10' == 10?
1 answered
#15What is the output of the following code?
What is the output of the following code?
```
print('Python'[::-1])
1 answered
#16What will be the output of the following code?
What will be the output of the following code?
```
my_dict = {'a': 1, 'b': 2}
print(my_dict.get('c', 3))
1 answered
#17
Which of the following is not a valid method for removing an item from a list in Python?
1 answered
#18
Which of the following statements is true about Python's 'map()' function?
1 answered
#19What is the output of the following code?
What is the output of the following code?
```
def func(x, y=2):
return x * y
print(func(3, 4))
1 answered
#20
What is the purpose of the 'finally' block in a try-except-finally statement in Python?
1 answered
#21
What does the 'self' keyword represent in Python class methods?
1 answered
#22
Which of the following statements is true about Python's garbage collection?
1 answered
#23
What is the purpose of the 'yield' keyword in Python?
1 answered
#24
Which of the following statements is true about Python's 'lambda' functions?
1 answered
#25
What does the 'super()' function do in Python?
1 answered