# Python 常用标准库(2)

json 序列化和反序列化

```python
# -*- coding: UTF-8 -*-
import json
if __name__ == '__main__':
    # TODO(You): 请在此实现json序列化和反序列化代码
    assert obj['key']['items'][2] == "test"
```

请选出下列能**正确**实现这一功能的选项。

## template

```python
import json
if __name__ == '__main__':
    obj = json.loads(json.dumps({"key": {"items": [1, 2, "test"]}}))
    assert obj['key']['items'][2] == "test"
```

## 答案

```python
obj = json.loads(json.dumps({"key": {"items": [1, 2, "test"]}}))
```

## 选项

### A

```python
obj = json.load(json.dumps({"key": {"items": [1, 2, "test"]}}))
```

### B

```python
obj = json.loads(json.dump({"key": {"items": [1, 2, "test"]}}))
```

### C

```python
obj = json.load(json.dump({"key": {"items": [1, 2, "test"]}}))
```
