Last active
February 28, 2018 18:44
-
-
Save fisherds/169d393e19cb72858b83 to your computer and use it in GitHub Desktop.
Code used in our Swift Playgrounds lecture
This file contains hidden or 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
| var myVariable = 42 | |
| myVariable = 50 | |
| let myConstant = 42 | |
| //myConstant = 50 | |
| let scores = [75, 52, 93, 87, 41, 83] | |
| var totalPassing = 0 | |
| for score in scores { | |
| if score >= 60 { | |
| totalPassing += 1 | |
| } | |
| } | |
| totalPassing | |
| print("\(totalPassing) passed out of \(scores.count) students") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment