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
cfaceb39
Commit
cfaceb39
authored
May 07, 2017
by
Tancredi Orlando
Browse files
Minor fixes.
parent
2869d1e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
day_1.md
View file @
cfaceb39
...
...
@@ -361,16 +361,21 @@ AttributeError: 'tuple' object has no attribute 'append'
## Unpacking
-
Estrarre valori da un contenitore
Estrarre valori da un contenitore
```
>>> t = (1, 2)
>>> a, b = t
>>> b
2
>>> a, b = b, a
>>> b
>>> a
2
>>> c, _ = t
>>> c
1
```
...
...
@@ -378,7 +383,7 @@ AttributeError: 'tuple' object has no attribute 'append'
## L'operatore `in`
-
Valuta l'appartenenza di un elemento ad una collezione
Valuta l'appartenenza di un elemento ad una collezione
```
>>> lista = ['a', 'b', 'c']
...
...
@@ -399,17 +404,16 @@ False
## Riferimenti
-
Quando assegniamo un oggetto ad una variabile, la variabile contiene solo un
*riferimento*
all'oggetto
-
Quando assegniamo un oggetto ad una variabile, la variabile contiene solo un
*riferimento*
all'oggetto
-
**Non**
l'oggetto stesso.
```
python
```
>>> spesa_a = ['mela', 'mango']
>>> spesa_b = spesa_a
>>> spesa_b.append('carota')
```
```
python
>>> spesa_a
['mela', 'mango', 'carota']
```
...
...
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