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 trialUnsubscribed User
7,386 Pointscreate a method called "hello" that takes one arguement.
I keep getting a response saying to contact Treehouse. Also, I'm not sure that I understand the question.
2 Answers
Steve Hunter
57,712 PointsHi Sarah,
You start a method with the def
keyword. You then name it. In this case, they want a method named hello
. This must all be closed with an end
keyword (I always add that as I type any def
else I forget later and wonder why it won't work!).
Arguments are passed into the method inside of brackets after the method name - I'll call mine argument
for the sake of ... oh. But you can call it anything you like, apart from reserved words. Putting all that together and you get:
def hello(argument)
end
That meets the requirements set so should be fine!
Steve.
Unsubscribed User
7,386 PointsThank you so much for your excellent and thorough explanation!
Steve Hunter
57,712 PointsNo problem! :-)