Skip to content

Instantly share code, notes, and snippets.

@fisherds
Last active February 28, 2018 18:44
Show Gist options
  • Select an option

  • Save fisherds/169d393e19cb72858b83 to your computer and use it in GitHub Desktop.

Select an option

Save fisherds/169d393e19cb72858b83 to your computer and use it in GitHub Desktop.
Code used in our Swift Playgrounds lecture
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