---
# System prepended metadata

title: 'Practice: Online Shopping'

---

---
title: 'Practice: Online Shopping'
---
# Practice: Online Shopping

## Try to develop a program to reach the following goals:
1. You can input what items and how many items you need to buy
2. The program can tell if your input is nonsense
3. The program can calculate the total fee you need to pay

### Menu

| Item             | Weight(g) | Price(USD) |
|------------------|-----------|------------|
| microphone       | 1134      | 399        |
| microphone Stand | 1140      | 15         |
| pop filter       | 454       | 19         |
| shock mount      | 160       | 20         |
| xlr cable        | 100       | 13         |
| headphone        | 590       | 145        |

### Shipping Fee

| Weight(g) | Shopping Fee(USD) |
|-----------|-------------------|
| ~200      | 1                 |
| 201~600   | 3                 |
| 601~1200  | 12                |
| 1201~2000 | 30                |
| 2001~3000 | 50                |
| 3001~     | 90                |

### Final Result
```
~$ python .\online_shopping.py
What do you need? (if no, please enter "no" to exit.)
microphone
How many do you need?
2
What do you need? (if no, please enter "no" to exit.)
xlr pp
Sorry, we don't have this.
What do you need? (if no, please enter "no" to exit.)
xlr cable
How many do you need?
gg
Please enter the correct integer.
How many do you need?
1
What do you need? (if no, please enter "no" to exit.)
no
Thank you.
The total fee is US$861.
```
