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

Şafak Otur
Şafak Otur
1,544 Points

Not working

Not working. I don't understand. Where am I making mistakes?

operators.swift
// Enter your code below

var initialScore = 8
initialScore += 1

let isWinner = 11
isWinner != 10

1 Answer

Thomas Dobson
Thomas Dobson
7,511 Points

Hi Safak,

You need to compare initalScore to 10. It cannot equal 10.

 initialScore != 10

then assign the boolean result of the above comparison to constant isWinner

let isWinner = initialScore != 10

Your final code should look like this:

// Enter your code below

var initialScore = 8
initialScore += 1

let isWinner = initialScore != 10

I hope this helps.

Şafak Otur
Şafak Otur
1,544 Points

Many thanks Thomas, I think this question is not very clear. I did not realize that I had to compare with initialScore.