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

Kavita Bargota
Kavita Bargota
2,741 Points

hi please help with this code challenge...


// Enter your code below

var initialScore = 8
initialScore += 1

let isWinner = 

1 Answer

Hi Kavita,

You need to compare initialScore to see if it is not equal to 10. Assign the result of that comparison into isWinner.

So, the comparison is initialScore != 10. Put that on the right of an equals sign and let isWinner on the left. That gives you:

let isWinner = initialScore != 10

So, isWinner contains true if initialScore doesn't contain 10, or false if it does contain 10.


Kavita Bargota
Kavita Bargota
2,741 Points

thanks Steve!!

I definitely need more practice :)

We ALL need practice! But this challenge is a little odd, to be honest. The test is a strange one but it is simple if you break down the requirements.