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 trialArius Eich
2,769 PointsNot operator-What is incorrect?
It tells me it cannot covert an integer value to a bool value. How do I make it do that?
// Enter your code below
var initialScore = 8
initialScore += 1
let isWinner = initialScore = !10
2 Answers
Matt Skelton
4,548 PointsHey Arius,
You're very close, the reason why you're getting the current error is because you're using the not operator directly on your integer value.
Instead, you want to move the not operator to the point where you compare the value of initialScore against the number 10.
let isWinner = initialScore != 10
Like so. This should do the trick, hope that helps!
Arius Eich
2,769 PointsThank you!