#1
Which of the following is NOT a valid variable name in Python?
3 answered
#2What is the output of the following code snippet?
What is the output of the following code snippet?
```python
print(3 * 2 ** 3)
3 answered
#3What is the output of the following code snippet?
What is the output of the following code snippet?
```python
print(5 == 5.0)
2 answered
#4
Which keyword is used to define a function in Python?
2 answered
#5
In Python, what does the 'pass' statement do?
1 answered
#6
In Python, what is the purpose of the 'break' statement?
#7What is the output of the following code snippet?
What is the output of the following code snippet?
```python
x = 5
y = 2
print(x % y)
#8
What is the purpose of the 'continue' statement in Python?
#9
In Python, how do you open a file in read mode?
#10What is the output of the following code snippet?
What is the output of the following code snippet?
```python
x = 5
y = 2
print(x // y)
#11
Which of the following is a mutable data type in Python?
#12
What is the purpose of a 'lambda' function in Python?
#13
In Python, what does the 'range()' function return?
#14
Which of the following is NOT a valid method of the 'list' class in Python?
#15What will be the output of the following code snippet?
What will be the output of the following code snippet?
```python
x = 'hello'
print(x[::-1])
#16What will be the output of the following code snippet?
What will be the output of the following code snippet?
```python
x = [1, 2, 3]
y = x
y[0] = 5
print(x[0])
#17What will be the output of the following code snippet?
What will be the output of the following code snippet?
```python
x = {1: 'one', 2: 'two'}
print(x.get(3, 'not found'))
#18What will be the output of the following code snippet?
What will be the output of the following code snippet?
```python
x = [1, 2, 3]
y = x.copy()
y[0] = 5
print(x[0])
#19
Which of the following is a correct way to comment multiple lines in Python?
#20What will be the output of the following code snippet?
What will be the output of the following code snippet?
```python
x = {'a': 1, 'b': 2}
print(x.get('c'))
#21What will be the output of the following code snippet?
What will be the output of the following code snippet?
```python
x = [1, 2, 3, 4, 5]
print(x[::2])
#22
In Python, which data structure is ordered, mutable, and allows duplicate elements?
#23What will be the output of the following code snippet?
What will be the output of the following code snippet?
```python
x = [1, 2, 3]
print(x[3:])
#24What will be the output of the following code snippet?
What will be the output of the following code snippet?
```python
x = [1, 2, 3]
print(x[-2:])
#25