Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Swift Basics Swift Operators Working With Operators: Part 2

Kavita Bargota
Kavita Bargota
2,741 Points

hi please help with this code challenge...

help

operators.swift
// Enter your code below

var initialScore = 8
initialScore += 1

let isWinner = 

1 Answer

Hi Kavita,

You need to compare initialScore to see if it is not equal to 10. Assign the result of that comparison into isWinner.

So, the comparison is initialScore != 10. Put that on the right of an equals sign and let isWinner on the left. That gives you:

let isWinner = initialScore != 10

So, isWinner contains true if initialScore doesn't contain 10, or false if it does contain 10.

Steve.

Kavita Bargota
Kavita Bargota
2,741 Points

thanks Steve!!

I definitely need more practice :)

We ALL need practice! But this challenge is a little odd, to be honest. The test is a strange one but it is simple if you break down the requirements.