Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Swift Basics Swift Operators Working With Operators: Part 2

I think I may be a little confused by the phrasing of this challenge.

I think I may be a little confused by the phrasing of this question. The winner is anyone who did not receive a 10. so let isWinner = !10, no?

// Enter your code below

var initialScore = 8

initialScore += 1 

let isWinner = intialScore !10

2 Answers

Jason Anders
Jason Anders
Treehouse Moderator 145,624 Points

Hey Michael,

Your thinking is on the right track, but the code just needs a little rearranging.

First off, you do have a typo in the last line of code. You are missing an "i" in initialScore.

Next, the not operator can't actually be used up against the integer like that, but you are correct in that you need to check that initialScore does not equal 10. So, instead of using it on the integer, you will use it with the equal sign to negate the equality, which means you will need to use !=. Hint: the last line of code will actually have 2 equal signs. One to assign the value and one with the negator to check the value. (Hope that helps)

Other than that, it's looking good. :)

Keep Coding! :dizzy:


Thank you for the help!