Locked lesson.
About this lesson
More on methods...
Exercise files
Download this lesson’s related exercise files.
Methods Part 2.docx60.3 KB Methods Part 2 - Solution.docx
58 KB
Quick reference
Methods Part 2
Let's look at methods in more depth.
When to use
Methods are important for most Ruby programming.
Instructions
Don't call a method before you define it, or you'll get an error.
You can pass as many parameters into a method as you like, as long as the method expects those parameters.
You can call a method from inside another method.
Try not to use puts in a method, instead use return and then "puts out" your method.
Hints & tips
- Be sure to only call your method after you define it!
Lesson notes are only available for subscribers.