Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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

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).