# More Handy Functions and the Random Package

## More Handy Functions and the Random Package

### Unpacking list of tuples:

```python
list_a = ['a', 'b', 'c', 'd', 'e', 'f']
list_b = [1,2,3,4,5,6]
list_c = [99,98,97,96,95,94]

zipped_list = list(zip(list_a, list_b, list_c))

# Unpacking a zipped list:
# You are unpacking each of the tuples
for a,b,c in zipped_list:
	print(a)
	print(b)
	print(c)
```

### Min/Max functions:

```python
list_num = [1,2,3,4,5,6]
max(list_num) # returns the highest number/string in the list
min(list_num) # retunrs the lowest number/string in the list
```

### Random Package:

### Getting a random number with `randint`:

```python
# Import the randint from the random library:
from random import randint
randint(0, 100) # Random number between 0 and 100
```

### Shuffle function:

```python
from random import shuffle
my_list = [1,2,3,4,5]
shuffle(my_list) # Shuffles the elements in the list
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.arkannis.net/programming/courses/python-pcap-31-03-course/control-flow/more-handy-functions-and-the-random-package.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
