Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Andrew
intro
Commits
9a594f5a
Commit
9a594f5a
authored
Apr 24, 2019
by
JackV
Browse files
Add the tuple section back
parent
8f229084
Changes
1
Show whitespace changes
Inline
Side-by-side
content.md
View file @
9a594f5a
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment