-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
arthurwrls
committed
Oct 30, 2022
1 parent
f4250a8
commit 3c73b82
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
Codecademy.playground/Pages/Body mass index.xcplaygroundpage/Contents.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Simple example of function | ||
// with return statement | ||
|
||
let weight = 70.0 // in Kilograms | ||
let height = 1.73 // in Meters | ||
|
||
|
||
func findBMI() -> Double { | ||
return weight / (height * height) | ||
} | ||
|
||
// Wrap function to print in console | ||
print(findBMI()) |
3c73b82
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small function example in swift