Created
October 17, 2016 01:17
-
-
Save ScorpIan555/eb32c9e7debce2651179903257b48b53 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| my_name = "Ian" | |
| puts "Hello" | |
| def greeting # here we say def to define a method and put the name of our method | |
| p "hello" # here’s the code inside our method | |
| end # and here we end or close our method | |
| greeting | |
| def greeting(name) | |
| p "hello" + " " + name | |
| end | |
| greeting("Ian") | |
| greeting(my_name) | |
| def greeting | |
| puts "Please enter your name:" | |
| name = gets.chomp | |
| puts "Hello" + " " + name | |
| end | |
| greeting |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment