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 am struggling with comparison operation and I am not using Xcode aswell. Please help me with this!

I passed the first task but what I am having a problem is with the comparison operation.

operators.swift
// Enter your code below

var initialScore = 8
initialScore += 1 

let isWinner = true

1 Answer

Hi there,

In this challenge you want to compare initialScore to the number 10. You want to know if the two are not equal. So, use !=. That expression results in a true/false value which you want to assign into isWinner with a single-equals sign, =.

So, create the constant, as you have done with let isWinner then assign, =, the expression initialScore != 10 into it.

That all looks like:

let isWinner = initalScore != 10

Make sense?

Steve.