Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. func simpleFunction() {
  2. print("This is a simple function")
  3. }
  4.  
  5. simpleFunction()
  6. //Output: This is a simple function
  7.  
  8. func secondFunction() {
  9. let friend1 = "Mike"
  10. let friend2 = "Lisa"
  11.  
  12. print("My best friends are \(friend1) and \(friend2)")
  13. }
  14.  
  15. secondFunction()
  16. //Output: My best friends are Mike and Lisa
  17.  
  18. func oneLastFunction() {
  19. let pi = Double.pi
  20.  
  21. print("The square root of pi is \(pi.squareRoot())")
  22. }
  23.  
  24. oneLastFunction()
  25. //Output: The square root of pi is 1.7724538509055159
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement