# Python 元组

<img src="https://img-mid.csdnimg.cn/release/static/image/mid/ask/321539019236199.jpg?x-oss-process=image/auto-orient,1/resize,w_320,m_lfit"/>

请选出下列元组**使用错误**的代码。

## template

```python
import math

if __name__ == '__main__':
    tuple1 = ('红色',)
    for element in tuple1:
        print(element)

    tuple = ('红色', '绿色', '蓝色')
    for element in tuple:
        print(element)

    print("不带括号的也是元组:")
    r, g, b = 0.6, 0.8, 0.3
    print("普通颜色[0-1]：({}, {}, {})".format(r, g, b))
    hr, hg, hb = (math.pow(r, 3/2), math.pow(g, 4/5), math.pow(b, 3/2))
    print("使用《黑客帝国》绿色滤镜算法计算后的颜色[0-1]：({}, {}, {})".format(hr, hg, hb))
```

## 答案

```python
tuple1 = ('红色')
for element in tuple1:
    print(element)
```

## 选项

### A

```python
tuple = ('红色', '绿色', '蓝色')
for element in tuple:
    print(element)
```

### B

```python
print("不带括号的也是元组:")
r, g, b = 0.6, 0.8, 0.3
print("普通颜色[0-1]：({}, {}, {})".format(r, g, b))
```

### C

```python
r, g, b = 0.6, 0.8, 0.3
hr, hg, hb = (math.pow(r, 3/2), math.pow(g, 4/5), math.pow(b, 3/2))
print("使用《黑客帝国》绿色滤镜算法计算后的颜色[0-1]：({}, {}, {})".format(hr, hg, hb))
```
