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

Sean Lafferty
Sean Lafferty
3,029 Points

I have no cleu how to o this

PLease help

operators.swift
// Enter your code below

var initialScore = 8

initialScore += 1

let isWinner = 10

1 Answer

Hi Sean,

This last bit is a little odd, I know!

First, you want to compare initialScore to the number 10. You want to check that initialScore is not equal to 10. You can use the != operator for that.

Once you've made the comparison, you want to assign that into isWinnersuch that isWinner will hold false if initialScore is 10 and true if initialScore is not 10. Just assign the comparison into the constant as if it were a value.

let isWinner = initialScore != 10

That's a strange one - good luck with the rest of the course!

Steve.