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

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?

operators.swift
// Enter your code below

var initialScore = 8

initialScore += 1 

let isWinner = intialScore !10

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 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:

Jason,

Thank you for the help!

Michael