Created
July 22, 2016 10:56
-
-
Save nelantone/1abeafda27f5b832707d62fa32d1fe7d to your computer and use it in GitHub Desktop.
3.1
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
| puts 'Hi there!' | |
| p 'Hi now also returning this string not only printing' | |
| def say_hi | |
| p 'I say hi to you!' | |
| end | |
| say_hi | |
| def say_hi(nickname) | |
| p 'Hello' + ' ' + nickname + ' nice nickname!' | |
| end | |
| say_hi('humpalumpa') | |
| new_nickname = "hodooor" | |
| say_hi(new_nickname) | |
| def greeting_and_get_name | |
| puts "Please enter your name" | |
| name = gets.chomp | |
| puts "Hello" + " " + name | |
| end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment