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

How do I code this comparison operator?

let isWinner = 9 !=10 // ??

operators.swift
// Enter your code below

var initialScore = 8
initialScore += 1 
let isWInner = // I'm stuck here trying to figure out this comparison operation 

1 Answer

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

Hi there! You're close here! In the first bit of code in your post you've gone ahead and added the numbers together yourself and compared them to 10. But that's the computer's job! That value of 9 is stored in initialScore. Try using the variable initialScore not equal to 10.

Also, in the first bit of code, you spelled isWinner correctly. But in the code in the black box, the variable is spelled incorrectly: isWInner. Note the capital I in the second version. Challenges are very exacting and things generally must match to the letter. This includes capitalisation, spacing, punctuation, and spelling.

I think you can get it with these hints, but let me know if you're still stuck! :sparkles: