iOS Swift Basics Swift Operators Working With Operators: Part 2

Jacob Skolnick
Jacob Skolnick
357 Points

Hi, I seem to be having trouble figuring out the right code for this task. Is the code supposed to be all on one line?

Please help me understand this better.

operators.swift
// Enter your code below

var initialScore = 8
initialScore += 1

let isWinner = !10

1 Answer

James Jenkins
James Jenkins
7,353 Points

Hey there Jacob,

You're close but you're not giving the isWinner constant a value to check against before it has an outcome (true or false).

Try this.

// Enter your code below

var initialScore = 8
initialScore += 1

let isWinner = initalScore != !10

If you're having trouble I would always recommend testing your solutions in X Code to verify the outcome. However always be weary of changes in Swift (version 3 to 4).