#compsci #python 

Module for iterations

## product()
Cartesian product

```python
import itertools
for i in itertools.product('ABCD',repeat=2):
	print(i)
	# AA AB AC AD BA BB .. DD
```

ALSO possible:

```python
import itertools
for i in itertools.product('AB','EF','CD'):
	print(i)
# AEC AED AFC AFD BEC BED BFC BFD
```

## permutations()
r-length tuples in all possible orderings, no rep. elements

```python
import itertools
for i in itertools.permutations('ABCD',2):
	print(i)
# AB AC AD BA BC BD CA CB CD DA DB DC
```

## combinations()
r-length tuples in sorted order, no rep. elements
```python
import itertools
for i in itertools.combinations('ABCD',2):
	print(i)
# AA AB AC AD BB BC BD CC CD DD
```