Welcome to the Treehouse Community
Looking to learn something new?
Jory Braun7,814 Points
Uh this is dumb, error: Did you include the boolean expression to evaluate? (value < 0) ?
(value < 0) ? textColor = "red" : textColor = "green";
int value = -1; string textColor = null; (value < 0) ? textColor = "red" : textColor = "green";
William LiCourses Plus Student 26,865 Points
I haven't taken this C# course, but usually I write the C# ternary this way.
textColor = (value < 0) ? "red" : "green";
Hope you find it helpful.
Charles Parko2,012 Points
I don't have an answer, but will add, that I have no idea why your code (which is identical to mine) didn't pass. I did exactly what the instructor shows in the video. It would be really nice if after awhile, we got an explanation around what's wrong.