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 trialwilliam miller
1,083 PointsI am afraid that I have not understood the way to modify concerning 'y', 'Y', and 'yes' 'YES'.
I am not even sure how to ask about a problem that I am not doing right. just general help as to why my answer is not working properly.
def valid_command?(command)
if (command =='y','Y') || (command == 'YES','yes')
end
end
2 Answers
William Li
Courses Plus Student 26,868 PointsIn Ruby, command =='y','Y'
and command == 'YES','yes'
aren't legal syntax.
the simplest way to solve this problem is
def valid_command?(command)
command == 'y' || 'Y' || 'yes' || 'YES'
end
william miller
1,083 PointsTo be honest I did it like this the first time although It reads syntax errors. its weird...it did that with the last challenge with the operators using &&....mystery
william miller
1,083 Pointswilliam miller
1,083 PointsGucci mayne........I was trying to do it as instructed by the ruby tutorial hosted by Jason Seifer......
William Li
Courses Plus Student 26,868 PointsWilliam Li
Courses Plus Student 26,868 PointsI see, let me watch how Jason did during the video.
William Li
Courses Plus Student 26,868 PointsWilliam Li
Courses Plus Student 26,868 Pointsokay, I believe this is the reasonable solution of the challenge based on the materials presented during the video lecture.