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 trial

Ruby Ruby Operators and Control Structures Ruby Operators Ruby Comparison Operators: Greater and Less Than or Equal To

What is wrong

print "How long is your nose: "

noseLength = gets.chomp
num_1 = 5
if noseLength <= num_1
    puts "Damn your nose is normal, otherwise i would eat you"
elsif nose_length >= 6
    puts "some damn long nose"
else
    puts "duds"
end

2 Answers

David Curtis
David Curtis
11,301 Points
print "How long is your nose: "
noseLength = gets.chomp
noseLength = noseLength.to_i
num_1 = 5
if noseLength <= num_1
    puts "Damn your nose is normal, otherwise i would eat you"
elsif noseLength >= 6
    puts "some damn long nose"
else
    puts "duds"
end

gets "gets" a string. you have to convert the answer to an integer. you also had a syntax error or two.

Thanks man

David Curtis
David Curtis
11,301 Points

you bet! if this worked for you, be sure to mark my answer as accepted so others will know.

good luck!