Version with Complete Solutions
What is the output of the following code?
```python
x=5
x += 3
print(x)
```
✔✔ 8
Which of the following will return the length of a string?
```python
x = "hello"
```
✔✔ `len(x)`
How would you create a function in Python?
1
,✔✔ `def my_function():`
What will this code print?
```python
x = [1, 2, 3, 4]
x.remove(3)
print(x)
```
✔✔ `[1, 2, 4]`
What is the output of this code?
```python
x = "apple"
print(x[1:4])
```
✔✔ `ppl`
2
, How do you check if a number is odd in Python?
✔✔ `if number % 2 != 0:`
What does the following code do?
```python
x = [5, 10, 15]
print(x[1])
```
✔✔ `10`
What will be the output of this code?
```python
x = {"name": "Alice", "age": 25}
print(x["age"])
```
3