While following the swift tour documentation i came across this block of code which is supposed to conditionally return a value, then gets stored in a variable. But then the compiler throws me an error.
Consecutive statements on a line must be separated by ';'
my code :
var teamScore = 0
for score in individualScores {
if score > 50 {
teamScore += 3
} else {
teamScore += 1
}
}
let scoreDecoration = if teamScore > 10 {
"🎉"
} else {
""
}
print("Score:", teamScore, scoreDecoration)
Screenshot