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 2.0 Basics Swift Operators Working With Operators: Part 2

Mohammed Abdulwahab
Mohammed Abdulwahab
1,477 Points

I'm having a trouble in this on as well !

I try the codes in Xcode and it is woking, while in here not ?

what could be the mistake !

operators2.swift
// Enter your code below

var initialScore = 8

let totalScore = ++initialScore

totalScore != 10

let isWinner = totalScore !=10

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

You have a line that's not needed and does nothing, so remove this:

totalScore != 10

And you need a space between the != and the 10. Like so:

let isWinner = totalScore != 10

While I feel like the last part is not necessary outside the challenge, the challenge requires it. I tried it without the space and it failed. Hope this helps! :dizzy:

Wow all your answers about everything are amazing. :thumbsup: You really should be a moderator! :smiley: