Created
March 19, 2013 17:35
-
-
Save maker-leo/5198253 to your computer and use it in GitHub Desktop.
Here's some exercises to go over tonight
This file contains 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
#create your own methods | |
#create a method with one argument, and print it out | |
#create a method with two arguments | |
#create a method with one argument, which by default is nil | |
#create a method that returns two values, depending on if an argument is true or false | |
#take this hash, and use it to make this string. Make sure you use the hash twice, | |
#and use string interpolation i.e. "A string #{variable}" | |
hash = {:dario => "Dario", :leo => "Leo"} | |
"Hello Dario, Hello Leo" | |
#Capitalize this array using map | |
["leo", "aouled", "dario", "ruben"] | |
#Select from this array only numbers bigger than 10 | |
[15,25,10, 9, 4, 345, 45] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment