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 trialJose Luis Ocaña
3,746 PointsWhy we have to test the varible to complete the program
We can complete the program without testing the variable? Thanks JOSE
Jose Luis Ocaña
3,746 PointsThanks Anastasios!
1 Answer
Justin Blalock
8,206 PointsThe tested variable, correctGuess , is a boolean and can only be true or false. You don't really need to add the extra conditional code since it is already built into the boolean variable.
Anastasios Poursaitedes
10,491 PointsAnastasios Poursaitedes
10,491 PointsHi Jose, I believe is just another way to represent a conditional statement. I think it's much faster to check right away the answer, although we possibly want to check, in a real world program which is much bigger and complex, additional statements to give to the user the right answer and I think it's much easier to keep track a variable.