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
c0693efd
Commit
c0693efd
authored
May 06, 2019
by
Enrico Tranquillini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
migliorata sezione args e kwargs
parent
e038e407
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
content.md
content.md
+4
-1
No files found.
content.md
View file @
c0693efd
...
...
@@ -334,6 +334,7 @@ ora x vale 3
risultato
-
Lo si specifica inserendo l'istruzione
`return`
seguita dal valore di ritorno
-
La funzione termina subito dopo l'istruzione return
-
La funzione return non può avere più di un argomento!
----
...
...
@@ -352,7 +353,9 @@ def f(a, b=3, c=6):
## \*args e \*\*kwargs
A volte ci tornerebbe comodo prendere una quantità indefinita di
argomenti, in questo caso gli
\*
args e
\*\*
kwargs vengono in nostro
aiuto
aiuto. (se non sappiamo cosa mettere prima della funzione)
** args **
---> elementi posizionali in una tupla Ex (1,2,3,4,8,9,10) o ("Ferruccio","Resta")
** kwargs **
--> elementi appartenenti ad un dizionario Ex: (nome = "Ferruccio", cognome = "Resta")
(N.B. Il nome
**args**
e
**kwargs**
è del tutto arbitrario, ma tuttavia
standandard de facto del linguaggio python)
...
...
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