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
979304a9
Commit
979304a9
authored
May 04, 2017
by
edne
Browse files
Fix code
parent
0a5efdb8
Changes
1
Hide whitespace changes
Inline
Side-by-side
day_1.md
View file @
979304a9
...
...
@@ -114,7 +114,7 @@ poi esegue quest'ultimo) e REPL (il software che si interfaccia con l'utente)
## Espressioni
```
python
```
>>> 2 + 2
4
>>> 3 * 3
...
...
@@ -129,7 +129,7 @@ True
o "Il segreto degli hacker"
```
python
```
>>> 3 / 0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
...
...
@@ -160,7 +160,7 @@ Diamo nomi alle cose.
### Cosa ho di fronte?
```
python
```
>>> type(3)
<class 'int'>
...
...
@@ -196,14 +196,15 @@ Diamo nomi alle cose.
### Stringhe
-
Stringhe (str)
-
`k = 'Una stringa!'
- `
s = "Un'altra stringa"
-
`k = 'Una stringa!'
`
-
`s = "Un'altra stringa"
`
-
Stringhe su più righe:
```
q = """riga 1
```
q = """riga 1
riga 2
- "#" * 5
"""
"""
```
-
"#"
*
5
`
----
...
...
@@ -211,7 +212,7 @@ riga 2
Contengono una certa qualtità di elementi, anche di tipi diversi.
```
```
python
lista = [1, "due", 3.0]
```
...
...
@@ -221,7 +222,7 @@ lista = [1, "due", 3.0]
Esattamente come le liste, ma immutabili.
```
```
python
tupla = ('a', 1, 2, 'bcd')
```
...
...
@@ -232,7 +233,7 @@ tupla = ('a', 1, 2, 'bcd')
- Come gli insiemi matematici,
- Non contengono elementi duplicati
```
```
python
insieme = {"mele", "pere", 2, "arance"}
```
...
...
@@ -243,7 +244,7 @@ insieme = {"mele", "pere", 2, "arance"}
- Associano una chiave ad un valore
- Le chiavi devono essere immutabili
```
```
python
dizionario = {
"nome":"Tancredi",
"cognome":"Orlando"
...
...
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