# Python Redis 安装说明

熟悉 Redis 的基本操作，下面的代码会打印：

1. 安装 redis
2. 启动 redis 服务的命令
3. 登录进入 redis 客户端
4. 安装 redis 的 Python 库

```python
# -*- coding: UTF-8 -*-
def dump_depends(depends):
    print()
    print("# 依赖配置")
    for i in range(0, len(depends)):
        print("{}. {}".format(i, depends[i]))

if __name__ == '__main__':
    start_server = #TODO(You): 请编写启动 redis 服务命令
    login_redis = #TODO(You): 请编写登录到 redis 的命令 

    dump_depends([
        '安装 redis ：https://redis.io/download',
        f'启动 redis 服务： {start_server}',
        f'进入 redis 命令行客户端: {login_redis}',
        '库安装: pip install redis',
    ])
```

以下 `start_server` 和 `login_redis` 命令字符串正确的是？

## template

```python

def dump_depends(depends):
    print()
    print("# 依赖配置")
    for i in range(0, len(depends)):
        print("{}. {}".format(i, depends[i]))

if __name__ == '__main__':
    start_server = 'redis-server'
    login_redis = 'redis-cli -h 127.0.0.1 -p 6379'

    dump_depends([
        '安装 redis ：https://redis.io/download',
        f'启动 redis 服务： {start_server}',
        f'进入 redis 命令行客户端: {login_redis}',
        '库安装: pip install redis',
    ])
```

## 答案

```python
start_server = 'redis-server'
login_redis = 'redis-cli -h 127.0.0.1 -p 6379'
```

## 选项

### A

```python
start_server = 'redis'
login_redis = 'redis-cli -h 127.0.0.1 -p 6379'
```

### B

```python
start_server = 'redis-server'
login_redis = 'redis -h 127.0.0.1 -p 6379'
```

### C

```python
start_server = 'redis'
login_redis = 'redis-cli -h 127.0.0.1 -P 6379'
```
