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

Yun Yin Ku
Yun Yin Ku
1,493 Points

Unable to make the isWinner declaration

Iā€™m currently stuck in !10 score for winner statement

operators.swift
// Enter your code below

var initialScore = 8
initialScore += 1

let isWinner = 9
10 != true

1 Answer

John Lack-Wilson
John Lack-Wilson
8,181 Points

Hey Yun, thanks for the question.

The challenge is asking you to do the following: Declare a constant named isWinner and assign the results of a comparison operation to check whether the player has won or not.

So, in other words it wants you to assign isWinner using a comparison operation (i.e. an operator that compares values). Here's a similar example to help, where I am declaring a constant to see if something is not 30.

var score = 15

let notThirty = score != 30

We can use '!=' to compare if something is not equal to something else.