iOS Swift Basics Swift Operators Working With Operators: Part 2

Yun Yin Ku
Yun Yin Ku
1,453 Points

Unable to make the isWinner declaration

I’m currently stuck in !10 score for winner statement

// Enter your code below

var initialScore = 8
initialScore += 1

let isWinner = 9
10 != true

1 Answer

John Lack-Wilson
John Lack-Wilson
8,155 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.