Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Nested-function/Swift/nested-function.swift
Normal file
13
Task/Nested-function/Swift/nested-function.swift
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
func makeList(_ separator: String) -> String {
|
||||
var counter = 1
|
||||
|
||||
func makeItem(_ item: String) -> String {
|
||||
let result = String(counter) + separator + item + "\n"
|
||||
counter += 1
|
||||
return result
|
||||
}
|
||||
|
||||
return makeItem("first") + makeItem("second") + makeItem("third")
|
||||
}
|
||||
|
||||
print(makeList(". "))
|
||||
Loading…
Add table
Add a link
Reference in a new issue