# Tuples

## Tuples

### Lists are mutable:

```python
my_list = [1, 2, 3]
my_list[1] = "NEW VALUE" # This has changed the list forever
```

### Tuples are immutable:

* Accessing the elements within a tuple is the same as for a list
* You can use slicing the same way as with lists

```python
my_tuple = (1, 2, 3, "some data", [1, 2, 3])
print(my_tuple[-1]) # Prints the list from the tuple

my_tuple[3] = "other data" # Tuples don't support item assignment
```

### You can change the items of a list within a tuple:

```python
my_tuple[-1][0] = "other data"
print(my_tuple) 
# Will print (1, 2, 3, "some data", ['other data', 2, 3])
```


---

# 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/lists-tuples-and-dictionaries/tuples.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.
