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

Re-ask

Hi all, I asked you guys before about how to solve this questions . Although your solution dont work but I still appriciate you willing to try and help me . And pls if u did this question and correct before , can u tell me how to solve this ? Thank you so much

operators.swift
var initialScore = 8
initialScore += 1

let isWinner != 10

1 Answer

Stuart Wright
Stuart Wright
41,120 Points

The correct solution is:

var initialScore = 8
initialScore += 1

let isWinner = initialScore != 10

Notice that the isWinner variable is assigned the result of comparing initialScore to 10. isWinner will be false if initialScore is 10, and true otherwise.

Thank you very much