Last active
October 31, 2015 07:22
-
-
Save vik-y/133140ef49080e91ea20 to your computer and use it in GitHub Desktop.
Some important things about ruby
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
#!/usr/bin/ruby | |
def sample (*test) | |
puts "The number of parameters is #{test.length}" | |
for i in 0...test.length | |
puts "The parameters are #{test[i]}" | |
end | |
end | |
sample "Zara", "6", "F" | |
sample "Mac", "36", "M", "MCA" | |
# We mentioned only one argument while defining the function | |
# but we can pass multiple arguments | |
# they will be treated as an array | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment