xxxxxxxxxx
func greet(person: String) -> String {
let greeting = "Hello, " + person + "!"
return greeting
}
xxxxxxxxxx
// declare a function
func greet() {
print("Hello World!")
}
// call the function
greet()
print("Outside function")
xxxxxxxxxx
func printInstructors(name: String) {
print(name)
}
//calling functions at end or it wont run
printInstructors(name: "john")