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!
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

Tyler _
6,651 Pointshi, what is wrong with my code?
def intro
name = gets "What is your name? "
age = gets "what is your age? "
favorite_books = gets "what is your favorite book? "
puts "Thanks for entering your info, I see your name is #{name}, age is #{age}, /n
and favorite book is #{favorite_books}."
return name,age,favorite_books
end
2 Answers

Owen Tran
6,822 Pointsputs "What is your name? "
name = gets.chomp
puts "what is your age? "
age = gets.chomp
puts "what is your favourite book? "
favourite_books = gets.chomp

Tyler _
6,651 PointsThanks Owen, now I'm trying to expand into using a method with my program. I still don't quite understand how to incorporate methods.
jonathanbello2
4,224 Pointsjonathanbello2
4,224 PointsHow are you calling the method?