Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
intro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Corsi
Slides Corsi Python
intro
Commits
46b635bb
Commit
46b635bb
authored
May 03, 2019
by
JackV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Slide fixups
parent
3c6c70e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
18 deletions
+12
-18
content.md
content.md
+12
-18
No files found.
content.md
View file @
46b635bb
...
...
@@ -173,19 +173,18 @@ Il segreto degli [hacker](http://www.girodivite.it/Diario-di-un-aspirante-hacker
>>> z
8
```
----
Le Variabili di Python non sono fisse e possono facilmente essere cambiate
Il tipo delle variabili Python può essere cambiato al volo
'''
>>> x = 2
>>> x
2
>>> type(x)
<class
'
int
'
>
>>> x = 'stringa'
>>> type(x)
<class
'
str
'
>
# facilmente si può modificare il tipo
# in linguaggi compilati tipo C ciò non è possibile
>>>
>>> x
'stringa'
'''
----
...
...
@@ -279,11 +278,10 @@ AttributeError: 'tuple' object has no attribute 'append'
-
Le chiavi devono essere immutabili (stringhe, tuple)
```
python
d
=
{
"chiave"
:
"valore"
,
"nome"
:
"Tancredi"
,
"cognome"
:
"Orlando"
,
(
'immutable'
,
'types'
):
[
'are'
,
'cool'
]
d
=
{
"chiave"
:
"valore"
,
"nome"
:
"Tancredi"
,
"cognome"
:
"Orlando"
,
(
'immutable'
,
'types'
):
[
'are'
,
'cool'
]
}
```
...
...
@@ -315,8 +313,8 @@ these things are cool
```
>>> s = 'Corsi {} {}'
>>> s.format('Python', '201
7
')
'Corsi Python 201
7
'
>>> s.format('Python', '201
9
')
'Corsi Python 201
9
'
>>> s.format('Linux', 'base')
'Corsi Linux base'
```
...
...
@@ -371,10 +369,6 @@ if 3 > 2:
-
Sono corpi di codice allineati con una spaziatura multipla coerente
-
Per bontà agli dèi usate quattro spazi ed evitate le tabulazioni come la peste
Notes:
Dire perché qua stiamo usando
`print`
e non scrivendo il valore e basta come
prima.
----
## `else`
...
...
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