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 trialCarl Smith
8,185 PointsCan't figure this one out, it's just telling me the "YES" statement is not valid?
Not sure what I'm doing wrong?
def valid_command?(command)
if(command = "y") || (command = "yes")
elsif (command = "Y") || (command = "YES")
end
end
1 Answer
Jennifer Nordell
Treehouse TeacherTo begin with you can write most of that on one line. The exercise asks you to return a value of true if any of those are true. But you never return a value at all. See my code for some clarification on what I mean.
def valid_command?(command)
if(command = "y") || (command = "yes") || (command = "Y") || (command = "YES")
return true
end
end
Carl Smith
8,185 PointsThat's exactly what I wrote and passed it right before you commented. This same thing happened to me earlier. Thank you for responding, this place is AWESOME!
Carl Smith
8,185 PointsCarl Smith
8,185 PointsI figured it out. Usually I try at it for a good hour before submitting a question. Seems as soon as I submit a question, I figure it out.