# Activities

**Identify** the **type** of errors in the following programs. **Explain** what is wrong with each.

{% hint style="warning" %}
### Identify

* Recognise and name
{% endhint %}

{% hint style="warning" %}
### **Explain:**

* Relate cause and effect.
* Make the relationships between things evident.
* Provide why and/or how.
{% endhint %}

1.

```python
def calculate_area(radius):
    area = 3.14 x radius x 2
    return area

print(calculate_area(5))
print(calculate_area(3))
```

2.

```python
def calculate_area(length, width):
    return length + width

area = calculate_area(5, 3)
print(f"Area: {area}")

```

3.

```python
def divide(a, b):
    return a / b

result = divide(10, 0)
print(result)
```

4.

```python
for i in range(5)
    print(i)
```

5.

```python
def calculate_average(numbers):
    total = sum(numbers)
    return total - len(numbers)

numbers = [10, 20, 30, 40]
average = calculate_average(numbers)
print(f"Average: {average}")
```

6.

```python
def calculate_area(diameter):
    return math.pi * diameter ** 2

print(calculate_area(5))
```
