Commit 9a594f5a authored by JackV's avatar JackV
Browse files

Add the tuple section back

parent 8f229084
......@@ -228,6 +228,32 @@ lista = [False, 1, "due", 3.0, 4, 5]
----
## Tuple (`tuple`)
- Esattamente come le liste, ma **immutabili**
- Sono quindi anche **ordinate**
- Si definiscono con le parentesi tonde
```python
tupla = ('a', 1, 2, '3.0')
```
```
>>> tupla[1] = 1.0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'tuple' object does not support item assignment
```
```
>>> tupla.append('sei')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'tuple' object has no attribute 'append'
```
----
## Dizionari (`dict`)
- Associano ogni chiave ad un valore
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment