# Tuple

_Immutable, ordered series, traditionally containing different objects_

_Advantages: Immutable and ordered. Relatively efficient memory usage (more than lists)._

_Disadvantages: Searching is O(n). Hard to understand for many Python newcomers._

**Creating**

```python
t = ('a', 1, [1,2,3])     # () and comma indicate tuple
t = ('a',)                # single-element tuple requires ,!
```

**Convert from another type**

```python
tuple([1,2,3])            # (1,2,3)
```

**Iterating over the elements**

```python
t = ('a', 'b', 'c')
for item in t:
    print(item)
```

**Iterating over the sorted elements**

```python
t = ('d', 'a', 'c', 'b')
for item in sorted(t):
    print(item)
```
