You are a Python programming teacher. You need to assign students an interesting Python case.

- The case is divided into several steps, and students can complete it step by step.
- Each step must contain Introduction, Example, Requirements, Answer and Test Case.
- Each Answer Code must contain a Test Case, and the Test Case must be passed.
- The Test Case is written in the form of a function, and the function name is the same as the Answer Code.
- All Code must contain docstring and type hint.
- using markdown to write the case.
You are a Python programming teacher. You need to assign students an interesting Python case.

- The case is divided into several steps, and students can complete it step by step.
- Each step must contain Introduction, Example, Requirements, Answer and Test Case.
- Each Answer Code must contain a Test Case, and the Test Case must be passed.
- The Test Case is written in the form of a function, and the function name is the same as the Answer Code.
- All Code must contain docstring and type hint.
- using markdown to write the case.

Case Name: **Python Calculator**

## Step 1: Basic Calculator

### Introduction

In this step, you will create a basic calculator using Python. The calculator will be able to perform four basic arithmetic operations: addition, subtraction, multiplication, and division.

### Example

```python
# Example 1: Addition
add(5, 3)  # Output: 8

# Example 2: Subtraction
subtract(7, 4)  # Output: 3

# Example 3: Multiplication
multiply(3, 5)  # Output: 15

# Example 4: Division
divide(10, 2)  # Output: 5
```

### Requirements

1. Create a function called `add` that takes two numbers as arguments and returns their sum.
2. Create a function called `subtract` that takes two numbers as arguments and returns their difference.
3. Create a function called `multiply` that takes two numbers as arguments and returns their product.
4. Create a function called `divide` that takes two numbers as arguments and returns their quotient.

### Answer

```python
def add(a: int, b: int) -> int:
    """


Introduction:

In this case, we will learn how to use the Python library to read data from a text file and then sort the data according to certain criteria. We will use the built-in functions of the library to read the data from the text file, sort the data according to the given criteria, and print the sorted data. 

Example:

We will use the following text file as an example: 

data.txt

John Smith 25
James Johnson 22
Adam Miller 24

Requirements:

Write a function called read_data() which takes a text file as an argument and returns a list of names and corresponding ages.

Answer:

def read_data(file_name):
    names = []
    ages = []
    with open(file_name, 'r') as f:
        for line in f:
            name, age = line.split(' ')
            names.append(name)
            ages.append(int(age))
    return names, ages

Test Case:

def sort_by_age():
    names, ages = read_data("data.txt")
    sorted_names = sorted(names, key=ages)
    print(sorted_names)

Test Case:

def sort_by_name():
    names, ages