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 trialRon Tovbin
Python Web Development Techdegree Student 6,268 PointsI've checked my code and it looks correct. This is frustrating.
var initialScore = 8 initialScore += 2
if initialScore != 10 { let isWinner = true } else { let isWinner = false }
// Enter your code below
var initialScore = 8
initialScore += 1
if initialScore != 10 {
let isWinner = true
} else {
let isWinner = false
}
3 Answers
Ivan Gonzalez
Courses Plus Student 1,771 PointsTry this: let isWinner = initialScore != 10
Thomas Dobson
7,511 PointsHi Ivan,
Your code is logically sound, works within xcode; but is a bit over complicated. As such its not quite what the challenge was looking for. You can simplify the solution a bit like so:
var initialScore = 8
initialScore += 1
let isWinner: Bool = (initialScore != 10)
You will find that some challenges are looking for specific ways to solve the problem, while other challenges will be more forgiving. I hope this helps!
Ron Tovbin
Python Web Development Techdegree Student 6,268 PointsThank you all !! Worked like a charm.
nicole lumpkin
Courses Plus Student 5,328 Pointsnicole lumpkin
Courses Plus Student 5,328 Pointswhich video/quiz/lecture is this in reference to?