Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
Alicja Dul8,589 Points
Challenge task 1 of 1 => We expected the "integer" variable to equal 123, but it was: nil
Someone can help me?
string = "123" def int integer = string.to_i end def float float = string.to_f end
Jennifer NordellTreehouse Teacher
Hi there! You're doing just fine, but the
def keyword is used to define methods/functions. Because the challenge has not asked for any user-defined methods or functions, it does not know to look for them so it can't see the variables you've made. If you remove the
end lines from around your variables, your code passes with flying colors!
Hope this helps!